feat(WEB-132): add middlewares, support for seamless login and improve lang based routes
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
import { auth } from "@/auth"
|
||||
import { auth, signIn } from "@/auth"
|
||||
|
||||
import type { LangParams, LayoutArgs } from "@/types/params"
|
||||
|
||||
@@ -14,7 +12,10 @@ export default async function ProtectedLayout({
|
||||
* protected route group is actually protected.
|
||||
*/
|
||||
if (!session) {
|
||||
return redirect(`/${params.lang}/login`)
|
||||
await signIn("curity", undefined, {
|
||||
ui_locales: params.lang,
|
||||
})
|
||||
return null
|
||||
}
|
||||
|
||||
return <>{children}</>
|
||||
|
||||
Reference in New Issue
Block a user