diff --git a/app/data/auth-provider.ts b/app/data/auth-provider.ts index 9b94720..05b1021 100644 --- a/app/data/auth-provider.ts +++ b/app/data/auth-provider.ts @@ -124,7 +124,12 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => { first_name: params.firstName, last_name: params.lastName, }); - return handleResponse({ret, redirectToSuccess: "/login"}); + return handleResponse({ + ret, redirectToSuccess: "/login", successNotification: { + message: "Registration Successful", + description: "You have successfully registered. Please check your email to verify your account.", + } + }); }, async forgotPassword(params: any): Promise { diff --git a/app/routes/register.tsx b/app/routes/register.tsx index 8690270..fa15ba9 100644 --- a/app/routes/register.tsx +++ b/app/routes/register.tsx @@ -47,11 +47,11 @@ export default function Register() { const login = useLogin(); const { open } = useNotification(); const [form, fields] = useForm({ - id: "register", - constraint: getZodConstraint(RegisterSchema), - onValidate({ formData }) { - return parseWithZod(formData, { schema: RegisterSchema }); - }, + id: "register", + constraint: getZodConstraint(RegisterSchema), + onValidate({formData}) { + return parseWithZod(formData, {schema: RegisterSchema}); + }, onSubmit(e) { e.preventDefault(); @@ -61,23 +61,9 @@ export default function Register() { password: data.password.toString(), firstName: data.firstName.toString(), lastName: data.lastName.toString(), - }, { - onSuccess: () => { - open?.({ - type: "success", - message: "Verify your Email", - description: "An Email was sent to your email address. Please verify your email address to activate your account.", - key: "register-success" - }) - login.mutate({ - email: data.email.toString(), - password: data.password.toString(), - rememberMe: false, - }) - } - }) - } - }); + }) + } + }); return (