Handle sign-up callback

Handle the callback after a user signs up.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 16:25:22 +00:00
parent a735dee195
commit 110f01f4ff
2 changed files with 5 additions and 3 deletions

View File

@@ -22,9 +22,10 @@ export const signUp = async (email: string, password: string, username: string)
return { error: { message: 'Supabase 설정이 올바르지 않습니다. 설정 페이지에서 확인해주세요.' }, user: null };
}
// 현재 브라우저 URL 가져오기 (localhost 대신 실제 도메인 사용)
// 현재 브라우저 URL 가져오기
const currentUrl = window.location.origin;
const redirectUrl = `${currentUrl}/login`;
// 해시 대신 쿼리 파라미터 방식으로 URL 구성 (auth_callback 파라미터 추가)
const redirectUrl = `${currentUrl}/login?auth_callback=true`;
console.log('이메일 인증 리디렉션 URL:', redirectUrl);

View File

@@ -24,7 +24,8 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
}
// 리디렉션 URL 설정 (전달되지 않은 경우 기본값 사용)
const finalRedirectUrl = redirectUrl || `${window.location.origin}/login`;
// 해시(#) 대신 쿼리 파라미터(?token=) 방식으로 URL 구성
const finalRedirectUrl = redirectUrl || `${window.location.origin}/login?auth_callback=true`;
console.log('이메일 인증 리디렉션 URL (API):', finalRedirectUrl);
// API 요청 전송