chore(debug): auth

This commit is contained in:
Michael Zetterberg
2024-05-14 16:32:17 +02:00
parent b054fc2597
commit 0a862ca770
3 changed files with 44 additions and 37 deletions

View File

@@ -0,0 +1,7 @@
import { auth } from "@/auth"
export default async function ByPass() {
const session = await auth()
return <pre>{JSON.stringify(session, null, 2)}</pre>
}

View File

@@ -1,4 +1,6 @@
import { auth, signIn } from "@/auth"
import { redirect } from "next/navigation"
import { auth } from "@/auth"
import type { LangParams, LayoutArgs } from "@/types/params"
@@ -12,10 +14,7 @@ export default async function ProtectedLayout({
* protected route group is actually protected.
*/
if (!session) {
await signIn("curity", undefined, {
ui_locales: params.lang,
})
return null
redirect(`/${params.lang}/login`)
}
return <>{children}</>