mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-20 17:28:32 +02:00
add redirect support to signup and verify email
This commit is contained in:
parent
7bfa17a293
commit
f14fb90ab6
5 changed files with 47 additions and 15 deletions
|
@ -70,12 +70,18 @@ export default function LoginForm({ redirect }: LoginFormProps) {
|
|||
setError(null);
|
||||
|
||||
if (res.data?.data?.emailVerificationRequired) {
|
||||
router.push("/auth/verify-email");
|
||||
if (redirect) {
|
||||
router.push(`/auth/verify-email?redirect=${redirect}`);
|
||||
} else {
|
||||
router.push("/auth/verify-email");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (redirect && typeof redirect === "string") {
|
||||
if (redirect && redirect.includes("http")) {
|
||||
window.location.href = redirect;
|
||||
} else if (redirect) {
|
||||
router.push(redirect);
|
||||
} else {
|
||||
router.push("/");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue