+5
-5
@@ -75,28 +75,28 @@ export default async function RootPage({ searchParams }: RootPageProps) {
|
||||
const currentLockState = getAdminLockState();
|
||||
|
||||
if (currentLockState.locked) {
|
||||
redirect("/root?error=locked");
|
||||
redirect("/?error=locked");
|
||||
}
|
||||
|
||||
if (!isAdminAuthConfigured() || !isPasswordValid(password)) {
|
||||
const failState = registerFailedAdminAttempt();
|
||||
if (failState.locked) {
|
||||
redirect("/root?error=locked");
|
||||
redirect("/?error=locked");
|
||||
}
|
||||
|
||||
redirect("/root?error=invalid");
|
||||
redirect("/?error=invalid");
|
||||
}
|
||||
|
||||
resetAdminFailedAttempts();
|
||||
setAdminSessionCookie();
|
||||
redirect("/root");
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
async function logoutAction() {
|
||||
"use server";
|
||||
|
||||
clearAdminSessionCookie();
|
||||
redirect("/root");
|
||||
redirect("/");
|
||||
}
|
||||
|
||||
if (!authenticated) {
|
||||
|
||||
Reference in New Issue
Block a user