sign in and register fixes for looped and forwarded pages
This commit is contained in:
parent
5257a0d2fe
commit
ffccff85d4
6 changed files with 68 additions and 20 deletions
|
|
@ -2,6 +2,7 @@
|
|||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import SignUp from "./sign-up";
|
||||
import { isJwtValid } from "@/lib/jwt";
|
||||
|
||||
export default async function SignUpPage({
|
||||
searchParams,
|
||||
|
|
@ -10,7 +11,7 @@ export default async function SignUpPage({
|
|||
}) {
|
||||
const ck = await cookies();
|
||||
const at = ck.get("ma_at")?.value;
|
||||
if (at) redirect("/portal");
|
||||
if (isJwtValid(at)) redirect("/portal");
|
||||
|
||||
const sp = searchParams ?? {};
|
||||
const nextParam = Array.isArray(sp.next) ? sp.next[0] : sp.next;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue