chore(debug): auth
This commit is contained in:
7
app/[lang]/(live)/(protected)/bypass/page.tsx
Normal file
7
app/[lang]/(live)/(protected)/bypass/page.tsx
Normal 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>
|
||||
}
|
||||
@@ -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}</>
|
||||
|
||||
Reference in New Issue
Block a user