Update error message
Update error message when signup is not allowed.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -12,6 +11,7 @@ interface RegisterFormProps {
|
||||
signUp: (email: string, password: string, username: string) => Promise<{
|
||||
error: any;
|
||||
user: any;
|
||||
redirectToSettings?: boolean;
|
||||
}>;
|
||||
serverStatus: {
|
||||
checked: boolean;
|
||||
@@ -119,12 +119,27 @@ const RegisterForm: React.FC<RegisterFormProps> = ({
|
||||
|
||||
try {
|
||||
// 회원가입 시도
|
||||
const { error, user } = await signUp(email, password, username);
|
||||
const { error, user, redirectToSettings } = await signUp(email, password, username);
|
||||
|
||||
if (error) {
|
||||
// 오류 메시지 출력
|
||||
setRegisterError(error.message || '알 수 없는 오류가 발생했습니다.');
|
||||
|
||||
// 설정 페이지 리디렉션이 필요한 경우
|
||||
if (redirectToSettings) {
|
||||
toast({
|
||||
title: "Supabase 설정 필요",
|
||||
description: "Supabase 설정을 확인하고 올바른 값을 입력해주세요.",
|
||||
variant: "destructive"
|
||||
});
|
||||
|
||||
// 2초 후 설정 페이지로 이동
|
||||
setTimeout(() => {
|
||||
navigate("/supabase-settings");
|
||||
}, 2000);
|
||||
return;
|
||||
}
|
||||
|
||||
// 네트워크 관련 오류인 경우 자세한 안내
|
||||
if (error.message && (
|
||||
error.message.includes('fetch') ||
|
||||
|
||||
Reference in New Issue
Block a user