Update error message
Update the error message displayed during sign-up.
This commit is contained in:
@@ -23,7 +23,8 @@ export const signUp = async (email: string, password: string, username: string)
|
||||
options: {
|
||||
data: {
|
||||
username, // 사용자 이름을 메타데이터에 저장
|
||||
}
|
||||
},
|
||||
emailRedirectTo: window.location.origin + '/login' // 이메일 인증 완료 후 리디렉션 URL
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,7 +35,8 @@ export const signUp = async (email: string, password: string, username: string)
|
||||
if (error.message.includes('json') ||
|
||||
error.message.includes('Unexpected end') ||
|
||||
error.message.includes('404') ||
|
||||
error.message.includes('Not Found')) {
|
||||
error.message.includes('Not Found') ||
|
||||
error.message.includes('Failed to fetch')) {
|
||||
console.warn('기본 회원가입 실패, 직접 API 호출 시도:', error.message);
|
||||
return await signUpWithDirectApi(email, password, username);
|
||||
}
|
||||
@@ -76,8 +78,12 @@ export const signUp = async (email: string, password: string, username: string)
|
||||
|
||||
// 사용자 데이터가 없는 경우 (드물게 발생)
|
||||
console.warn('회원가입 응답은 성공했지만 사용자 데이터가 없습니다');
|
||||
showAuthToast('회원가입 문제', '계정이 생성되었으나 응답에 사용자 정보가 없습니다.', 'destructive');
|
||||
return { error: { message: '회원가입 완료 처리 중 문제가 발생했습니다.' }, user: null };
|
||||
showAuthToast('회원가입 성공', '계정이 생성되었습니다. 로그인해주세요.', 'default');
|
||||
return {
|
||||
error: null,
|
||||
user: { email },
|
||||
message: '회원가입 완료'
|
||||
};
|
||||
} catch (error: any) {
|
||||
console.error('기본 회원가입 프로세스 예외:', error);
|
||||
|
||||
@@ -86,7 +92,9 @@ export const signUp = async (email: string, password: string, username: string)
|
||||
error.message.includes('json') ||
|
||||
error.message.includes('fetch') ||
|
||||
error.message.includes('404') ||
|
||||
error.message.includes('Not Found'))) {
|
||||
error.message.includes('Not Found') ||
|
||||
error.message.includes('timed out') ||
|
||||
error.message.includes('Failed to fetch'))) {
|
||||
console.warn('직접 API 호출로 재시도:', error);
|
||||
return await signUpWithDirectApi(email, password, username);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user