Fix signup redirect URL

The signup redirect URL was incorrect, leading to issues with email verification. This commit fixes the URL to ensure proper redirection after signup.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 16:15:59 +00:00
parent 4d094fbaa8
commit 7024c6423f
2 changed files with 20 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ import { getProxyType, isCorsProxyEnabled, getSupabaseUrl, getOriginalSupabaseUr
/**
* 직접 API 호출을 통한 회원가입
*/
export const signUpWithDirectApi = async (email: string, password: string, username: string) => {
export const signUpWithDirectApi = async (email: string, password: string, username: string, redirectUrl?: string) => {
try {
console.log('직접 API 호출로 회원가입 시도 중');
@@ -24,6 +24,10 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
};
}
// 리디렉션 URL 설정 (전달되지 않은 경우 기본값 사용)
const finalRedirectUrl = redirectUrl || `${window.location.origin}/login`;
console.log('이메일 인증 리디렉션 URL (API):', finalRedirectUrl);
// 프록시 정보 로깅
const usingProxy = isCorsProxyEnabled();
const proxyType = getProxyType();
@@ -51,7 +55,8 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
body: JSON.stringify({
email,
password,
data: { username } // 사용자 메타데이터에 username 추가
data: { username }, // 사용자 메타데이터에 username 추가
redirect_to: finalRedirectUrl // 리디렉션 URL 추가
}),
signal: AbortSignal.timeout(15000) // 타임아웃 시간 증가
});