fix(SW-360): redirect verify step when authed as well
This commit is contained in:
committed by
Pontus Dreij
parent
bf8976c24c
commit
c21a0cd18b
@@ -1,5 +1,11 @@
|
|||||||
|
import { redirect } from "next/navigation"
|
||||||
|
|
||||||
|
import { overview } from "@/constants/routes/myPages"
|
||||||
|
|
||||||
|
import { auth } from "@/auth"
|
||||||
import LoginButton from "@/components/Current/Header/LoginButton"
|
import LoginButton from "@/components/Current/Header/LoginButton"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
import { getLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import styles from "./signUpVerification.module.css"
|
import styles from "./signUpVerification.module.css"
|
||||||
|
|
||||||
@@ -9,6 +15,10 @@ export default async function SignUpVerification({
|
|||||||
title,
|
title,
|
||||||
subtitle,
|
subtitle,
|
||||||
}: SignUpVerificationProps) {
|
}: SignUpVerificationProps) {
|
||||||
|
const session = await auth()
|
||||||
|
if (session) {
|
||||||
|
redirect(overview[getLang()])
|
||||||
|
}
|
||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default async function SignupFormWrapper({
|
|||||||
}) {
|
}) {
|
||||||
const session = await auth()
|
const session = await auth()
|
||||||
if (session) {
|
if (session) {
|
||||||
// We don't want to allow users to signup if they are already authenticated.
|
// We don't want to allow users to access signup if they are already authenticated.
|
||||||
redirect(overview[getLang()])
|
redirect(overview[getLang()])
|
||||||
}
|
}
|
||||||
return <Form {...dynamic_content} />
|
return <Form {...dynamic_content} />
|
||||||
|
|||||||
@@ -17,5 +17,3 @@ export const signupVerify: LangRoute = {
|
|||||||
da: `${signup.da}/bekraeft`,
|
da: `${signup.da}/bekraeft`,
|
||||||
de: `${signup.de}/verifizieren`,
|
de: `${signup.de}/verifizieren`,
|
||||||
}
|
}
|
||||||
|
|
||||||
// export const signup = [...Object.values(signupRoutes)]
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
"As our Close Friend": "Som vores nære ven",
|
"As our Close Friend": "Som vores nære ven",
|
||||||
"At latest": "Senest",
|
"At latest": "Senest",
|
||||||
"At the hotel": "På hotellet",
|
"At the hotel": "På hotellet",
|
||||||
"Attraction": "Attraktion",
|
"Attractions": "Attraktioner",
|
||||||
"Back to scandichotels.com": "Tilbage til scandichotels.com",
|
"Back to scandichotels.com": "Tilbage til scandichotels.com",
|
||||||
"Bar": "Bar",
|
"Bar": "Bar",
|
||||||
"Bed type": "Seng type",
|
"Bed type": "Seng type",
|
||||||
|
|||||||
Reference in New Issue
Block a user