@@ -2,6 +2,7 @@ import { ChangeEvent, useState } from 'react';
22import { useLocation } from 'react-router-dom' ;
33import { TermKey } from '@ts/Term' ;
44import useRouter from '@router/useRouter' ;
5+ import useAuthInfo from '@hooks/useAuthInfo' ;
56import Button from '@components/Common/Button' ;
67import MyPageInput , { MyPageInputProps } from '@components/MyPage/MyPageInput/MyPageInput' ;
78import ProfileCircle from '@components/MyPage/ProfileCircle/ProfileCircle' ;
@@ -51,6 +52,7 @@ const termInputs: TermInputItem[] = [
5152const Register = ( ) => {
5253 const { navToRegisterDone, navToTerm } = useRouter ( ) ;
5354 const location = useLocation ( ) ;
55+ const { setAuthInfo } = useAuthInfo ( ) ;
5456
5557 // WebView 환경 감지
5658 const isWebView = ! ! ( window as any ) . ReactNativeWebView ;
@@ -258,6 +260,16 @@ const Register = () => {
258260
259261 if ( ! res ) return ;
260262
263+ // 토큰 및 사용자 정보 저장 (브라우저/WebView 모두)
264+ if ( res . access_token && res . refresh_token ) {
265+ setAuthInfo ( res . access_token , res . refresh_token , {
266+ email : values . email ,
267+ nickname : values . name ,
268+ profileImage : profileImage || undefined ,
269+ provider : provider . toUpperCase ( ) ,
270+ } ) ;
271+ }
272+
261273 // sessionStorage 정리
262274 sessionStorage . removeItem ( 'register_email' ) ;
263275 sessionStorage . removeItem ( 'register_provider' ) ;
@@ -270,10 +282,9 @@ const Register = () => {
270282 token : res . access_token ,
271283 } ) ,
272284 ) ;
273- return ;
274285 }
275286
276- // 일반 브라우저: Done 페이지로 이동
287+ // Done 페이지로 이동
277288 navToRegisterDone ( ) ;
278289 } ;
279290
0 commit comments