|
1 | | -import { MESSAGE_TYPES } from '@config/webview'; |
2 | 1 | import { ChangeEvent, useState } from 'react'; |
3 | 2 | import { useLocation } from 'react-router-dom'; |
4 | 3 | import { TermKey } from '@ts/Term'; |
5 | | -import useAuthInfo from '@hooks/useAuthInfo'; |
6 | 4 | import useRouter from '@router/useRouter'; |
7 | 5 | import Button from '@components/Common/Button'; |
8 | 6 | import MyPageInput, { MyPageInputProps } from '@components/MyPage/MyPageInput/MyPageInput'; |
@@ -53,10 +51,6 @@ const termInputs: TermInputItem[] = [ |
53 | 51 | const Register = () => { |
54 | 52 | const { navToRegisterDone, navToTerm } = useRouter(); |
55 | 53 | const location = useLocation(); |
56 | | - const { setAuthInfo } = useAuthInfo(); |
57 | | - |
58 | | - // WebView 환경 감지 |
59 | | - const isWebView = !!(window as any).ReactNativeWebView; |
60 | 54 |
|
61 | 55 | const [values, setValues] = useState({ |
62 | 56 | name: '', |
@@ -261,39 +255,11 @@ const Register = () => { |
261 | 255 |
|
262 | 256 | if (!res) return; |
263 | 257 |
|
264 | | - // 토큰 및 사용자 정보 저장 (브라우저/WebView 모두) |
265 | | - if (res.access_token && res.refresh_token) { |
266 | | - setAuthInfo(res.access_token, res.refresh_token, { |
267 | | - email: values.email, |
268 | | - nickname: values.name, |
269 | | - profileImage: profileImage || undefined, |
270 | | - provider: provider.toUpperCase(), |
271 | | - }); |
272 | | - } |
273 | | - |
274 | 258 | // sessionStorage 정리 |
275 | 259 | sessionStorage.removeItem('register_email'); |
276 | 260 | sessionStorage.removeItem('register_provider'); |
277 | 261 |
|
278 | | - // WebView인 경우 네이티브 앱에도 알림 |
279 | | - if (isWebView && (window as any).ReactNativeWebView) { |
280 | | - (window as any).ReactNativeWebView.postMessage( |
281 | | - JSON.stringify({ |
282 | | - type: MESSAGE_TYPES.TOKEN, |
283 | | - token: res.access_token, |
284 | | - }), |
285 | | - ); |
286 | | - } |
287 | | - |
288 | | - if (isWebView && (window as any).ReactNativeWebView) { |
289 | | - (window as any).ReactNativeWebView.postMessage( |
290 | | - JSON.stringify({ |
291 | | - type: MESSAGE_TYPES.REQUEST_NOTIFICATION_PERMISSION, |
292 | | - token: res.access_token, |
293 | | - }), |
294 | | - ); |
295 | | - } |
296 | | - // Done 페이지로 이동 |
| 262 | + // 회원가입 완료 페이지로 이동 (로그인은 사용자가 직접 수행) |
297 | 263 | navToRegisterDone(); |
298 | 264 | }; |
299 | 265 |
|
|
0 commit comments