Skip to content

Commit 0f4e3f5

Browse files
feat: login handler 함수에 hasJob localstorage 저장 로직 추가
1 parent bfe025d commit 0f4e3f5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/client/src/pages/onBoarding/GoogleCallback.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const GoogleCallback = () => {
2121

2222
const handleUserLogin = (
2323
isUser: boolean,
24-
accessToken: string | undefined
24+
accessToken: string | undefined,
25+
hasJob?: boolean
2526
) => {
2627
if (isUser) {
2728
if (accessToken) {
@@ -38,6 +39,9 @@ const GoogleCallback = () => {
3839
};
3940
sendTokenToExtension(accessToken);
4041
}
42+
if (hasJob !== undefined) {
43+
localStorage.setItem('hasJob', String(hasJob));
44+
}
4145
navigate('/');
4246
} else {
4347
navigate('/onboarding?step=ALARM');
@@ -54,12 +58,12 @@ const GoogleCallback = () => {
5458
code,
5559
uri: redirectUri,
5660
});
57-
const { isUser, userId, email, accessToken } = res.data.data;
61+
const { isUser, userId, email, accessToken, hasJob } = res.data.data;
5862

5963
localStorage.setItem('email', email);
6064
localStorage.setItem('userId', userId);
6165

62-
handleUserLogin(isUser, accessToken);
66+
handleUserLogin(isUser, accessToken, hasJob);
6367
} catch (error) {
6468
console.error('로그인 오류:', error);
6569
navigate('/onboarding?step=SOCIAL_LOGIN');

0 commit comments

Comments
 (0)