Skip to content

Commit 709275b

Browse files
committed
Revert "fix: Chrome Custom Tabs 차단 우회를 위해 클릭 가능한 버튼 UI 추가"
This reverts commit a19c077.
1 parent a19c077 commit 709275b

1 file changed

Lines changed: 6 additions & 28 deletions

File tree

src/hooks/useSocialAuth.ts

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -202,22 +202,11 @@ export const useSocialAuth = () => {
202202

203203
if (parsedState?.fromWebView) {
204204
// WebView에서 온 경우 커스텀 스킴으로 복귀 (Android/iOS 모두 동일)
205+
// Chrome Custom Tabs에서 자동 리다이렉트 차단을 우회하기 위해 약간 지연
205206
const errorParam = `error=${encodeURIComponent(error)}`;
206-
const deepLinkUrl = `${URL_SCHEME}?${errorParam}`;
207-
208-
// Chrome Custom Tabs 차단 우회: 즉시 시도 + 클릭 가능한 링크 제공
209-
window.location.href = deepLinkUrl;
210-
211-
// 500ms 후에도 페이지가 그대로 있으면 사용자에게 링크 제공
212207
setTimeout(() => {
213-
document.body.innerHTML = `
214-
<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;padding:20px;text-align:center;font-family:sans-serif;">
215-
<h2 style="margin-bottom:20px;">로그인 실패</h2>
216-
<p style="margin-bottom:30px;color:#666;">앱으로 돌아가려면 아래 버튼을 클릭하세요</p>
217-
<a href="${deepLinkUrl}" style="display:inline-block;padding:15px 30px;background:#007AFF;color:white;text-decoration:none;border-radius:8px;font-size:16px;">앱으로 돌아가기</a>
218-
</div>
219-
`;
220-
}, 500);
208+
window.location.href = `${URL_SCHEME}?${errorParam}`;
209+
}, 100);
221210
} else {
222211
setError('로그인에 실패했습니다. 다시 시도해주세요.');
223212
setIsLoading(false);
@@ -231,22 +220,11 @@ export const useSocialAuth = () => {
231220

232221
if (parsedState?.fromWebView) {
233222
// WebView에서 온 경우 커스텀 스킴으로 복귀 (Android/iOS 모두 동일)
223+
// Chrome Custom Tabs에서 자동 리다이렉트 차단을 우회하기 위해 약간 지연
234224
const params = `code=${encodeURIComponent(code)}&provider=${parsedState.provider || ''}&state=${encodeURIComponent(stateParam || '')}`;
235-
const deepLinkUrl = `${URL_SCHEME}?${params}`;
236-
237-
// Chrome Custom Tabs 차단 우회: 즉시 시도 + 클릭 가능한 링크 제공
238-
window.location.href = deepLinkUrl;
239-
240-
// 500ms 후에도 페이지가 그대로 있으면 사용자에게 링크 제공
241225
setTimeout(() => {
242-
document.body.innerHTML = `
243-
<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;height:100vh;padding:20px;text-align:center;font-family:sans-serif;">
244-
<h2 style="margin-bottom:20px;">로그인 성공!</h2>
245-
<p style="margin-bottom:30px;color:#666;">앱으로 돌아가려면 아래 버튼을 클릭하세요</p>
246-
<a href="${deepLinkUrl}" style="display:inline-block;padding:15px 30px;background:#007AFF;color:white;text-decoration:none;border-radius:8px;font-size:16px;">앱으로 돌아가기</a>
247-
</div>
248-
`;
249-
}, 500);
226+
window.location.href = `${URL_SCHEME}?${params}`;
227+
}, 100);
250228
} else {
251229
// 브라우저에서 온 경우: URL 파라미터 제거 후 처리하여 무한 루프 방지
252230
const provider = location.pathname.split('/').at(-1);

0 commit comments

Comments
 (0)