Skip to content

Commit d434bf5

Browse files
committed
fix: 회원가입 로직에서 WebView 관련 코드 제거 및 인증 정보 저장 로직 수정
1 parent 58b5413 commit d434bf5

1 file changed

Lines changed: 1 addition & 35 deletions

File tree

src/pages/Register/Register.tsx

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { MESSAGE_TYPES } from '@config/webview';
21
import { ChangeEvent, useState } from 'react';
32
import { useLocation } from 'react-router-dom';
43
import { TermKey } from '@ts/Term';
5-
import useAuthInfo from '@hooks/useAuthInfo';
64
import useRouter from '@router/useRouter';
75
import Button from '@components/Common/Button';
86
import MyPageInput, { MyPageInputProps } from '@components/MyPage/MyPageInput/MyPageInput';
@@ -53,10 +51,6 @@ const termInputs: TermInputItem[] = [
5351
const Register = () => {
5452
const { navToRegisterDone, navToTerm } = useRouter();
5553
const location = useLocation();
56-
const { setAuthInfo } = useAuthInfo();
57-
58-
// WebView 환경 감지
59-
const isWebView = !!(window as any).ReactNativeWebView;
6054

6155
const [values, setValues] = useState({
6256
name: '',
@@ -261,39 +255,11 @@ const Register = () => {
261255

262256
if (!res) return;
263257

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-
274258
// sessionStorage 정리
275259
sessionStorage.removeItem('register_email');
276260
sessionStorage.removeItem('register_provider');
277261

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+
// 회원가입 완료 페이지로 이동 (로그인은 사용자가 직접 수행)
297263
navToRegisterDone();
298264
};
299265

0 commit comments

Comments
 (0)