File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ import { useSignUpForm } from '@/page/signup/hook/useSignUpForm';
99import { PATH } from '@/route' ;
1010import { usePostSignUp } from '@/api/domain/signup/hook/usePostSignup' ;
1111import type { SignupRequest } from '@/api/domain/signup/type/SignupRequest' ;
12- import { useGoogleAuth } from '@/common/hook/useGoogleAuth' ;
12+ import getGoogleAuthCode from '@/api/auth/googleLogin/util/getGoogleAuthCode' ;
13+ import getAccessToken from '@/api/auth/googleLogin/util/getAccessToken' ;
1314
1415const SIGNUP_MESSAGE = '회원가입 후 NiNE DOT를 만나보세요!' ;
1516const FIT_INFO_MESSAGE = '내 성향을 선택하고 맞춤형 목표 추천을 받아보세요' ;
@@ -48,8 +49,19 @@ const SignUp = () => {
4849 } ;
4950
5051 signUp ( payload , {
51- onSuccess : ( ) => {
52- useGoogleAuth ( ) ;
52+ onSuccess : async ( ) => {
53+ try {
54+ const code = getGoogleAuthCode ( ) ;
55+ if ( code ) {
56+ const data = await getAccessToken ( code ) ;
57+ if ( data . accessToken ) {
58+ localStorage . setItem ( 'accessToken' , data . accessToken ) ;
59+ }
60+ }
61+ } catch ( e ) {
62+ console . error ( '토큰 교환 실패:' , e ) ;
63+ }
64+
5365 navigate ( PATH . INTRO , { state : { pageState : 'MANDALART' } } ) ;
5466 } ,
5567 onError : ( ) => { } ,
You can’t perform that action at this time.
0 commit comments