feat(auth): add better-auth core wiring for admin and db
This commit is contained in:
18
apps/admin/src/app/login/page.tsx
Normal file
18
apps/admin/src/app/login/page.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import { isAdminRegistrationEnabled } from "@cms/auth/server"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
import { resolveRoleFromServerContext } from "@/lib/access-server"
|
||||
|
||||
import { LoginForm } from "./login-form"
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
export default async function LoginPage() {
|
||||
const role = await resolveRoleFromServerContext()
|
||||
|
||||
if (role) {
|
||||
redirect("/")
|
||||
}
|
||||
|
||||
return <LoginForm allowRegistration={isAdminRegistrationEnabled()} />
|
||||
}
|
||||
Reference in New Issue
Block a user