feat(admin-auth): add first-start onboarding flow and dev db reset command
This commit is contained in:
23
apps/admin/src/app/support/[key]/page.tsx
Normal file
23
apps/admin/src/app/support/[key]/page.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { notFound, redirect } from "next/navigation"
|
||||
import { LoginForm } from "@/app/login/login-form"
|
||||
import { resolveRoleFromServerContext } from "@/lib/access-server"
|
||||
import { resolveSupportLoginKey } from "@/lib/auth/server"
|
||||
|
||||
export const dynamic = "force-dynamic"
|
||||
|
||||
type Params = Promise<{ key: string }>
|
||||
|
||||
export default async function SupportLoginPage({ params }: { params: Params }) {
|
||||
const { key } = await params
|
||||
const role = await resolveRoleFromServerContext()
|
||||
|
||||
if (role) {
|
||||
redirect("/")
|
||||
}
|
||||
|
||||
if (key !== resolveSupportLoginKey()) {
|
||||
notFound()
|
||||
}
|
||||
|
||||
return <LoginForm mode="signin" />
|
||||
}
|
||||
Reference in New Issue
Block a user