Update error message
Update error message when signup is not allowed.
This commit is contained in:
@@ -15,6 +15,15 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
|
||||
const proxyUrl = getSupabaseUrl(); // 프록시 적용된 URL
|
||||
const supabaseKey = localStorage.getItem('supabase_key') || supabase.supabaseKey;
|
||||
|
||||
// Supabase 키 유효성 검사
|
||||
if (!supabaseKey || supabaseKey.includes('your-onpremise-anon-key')) {
|
||||
return {
|
||||
error: { message: 'Supabase 설정이 올바르지 않습니다. 설정 페이지에서 확인해주세요.' },
|
||||
user: null,
|
||||
redirectToSettings: true
|
||||
};
|
||||
}
|
||||
|
||||
// 프록시 정보 로깅
|
||||
const usingProxy = isCorsProxyEnabled();
|
||||
const proxyType = getProxyType();
|
||||
@@ -49,12 +58,23 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
|
||||
|
||||
console.log('회원가입 응답 상태:', response.status);
|
||||
|
||||
// 401 오류 처리 (권한 없음)
|
||||
if (response.status === 401) {
|
||||
showAuthToast('회원가입 실패', '회원가입 권한이 없습니다. Supabase 설정 또는 권한을 확인하세요.', 'destructive');
|
||||
return {
|
||||
error: { message: '회원가입 권한이 없습니다. Supabase 설정 또는 권한을 확인하세요.' },
|
||||
user: null,
|
||||
redirectToSettings: true
|
||||
};
|
||||
}
|
||||
|
||||
// HTTP 상태 코드 확인
|
||||
if (response.status === 404) {
|
||||
showAuthToast('회원가입 실패', '서버 경로를 찾을 수 없습니다. Supabase URL을 확인하세요.', 'destructive');
|
||||
return {
|
||||
error: { message: '서버 경로를 찾을 수 없습니다. Supabase URL을 확인하세요.' },
|
||||
user: null
|
||||
user: null,
|
||||
redirectToSettings: true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -75,7 +95,8 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
|
||||
error: {
|
||||
message: '회원가입 권한이 없습니다. Supabase 설정 또는 권한을 확인하세요.'
|
||||
},
|
||||
user: null
|
||||
user: null,
|
||||
redirectToSettings: true
|
||||
};
|
||||
}
|
||||
|
||||
@@ -147,7 +168,7 @@ export const signUpWithDirectApi = async (email: string, password: string, usern
|
||||
else if (response.status === 401) {
|
||||
const errorMessage = '회원가입 권한이 없습니다. Supabase 설정 또는 권한을 확인하세요.';
|
||||
showAuthToast('회원가입 실패', errorMessage, 'destructive');
|
||||
return { error: { message: errorMessage }, user: null };
|
||||
return { error: { message: errorMessage }, user: null, redirectToSettings: true };
|
||||
}
|
||||
// 다른 모든 오류 상태
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user