feat(auth) : add optional email verification and profile setup
This commit is contained in:
@@ -33,7 +33,7 @@ export function RegistrationOtpForm({ email, nextPath, setup }: {
|
||||
try {
|
||||
const result = await authClient.emailOtp.verifyEmail({ email: address, otp });
|
||||
if (result.error) throw new Error("รหัสไม่ถูกต้องหรือหมดอายุ กรุณาลองอีกครั้ง");
|
||||
const returnPath = setup ? `/profile?setup=1&next=${encodeURIComponent(nextPath)}` : nextPath;
|
||||
const returnPath = setup ? `/auth/register?step=profile&next=${encodeURIComponent(nextPath)}` : nextPath;
|
||||
router.replace(returnPath);
|
||||
router.refresh();
|
||||
} catch (cause) {
|
||||
|
||||
Reference in New Issue
Block a user