create a login page /auth

This commit is contained in:
Leon Serfaty G
2025-09-01 07:04:00 +00:00
parent 5b8eaf9cb9
commit f2f97ce9f1
6 changed files with 5 additions and 5 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -37,7 +37,7 @@ async function AdminLayout({
if (!session) {
// This should be handled by middleware, but as a fallback
const { redirect } = await import("next/navigation")
redirect("/login")
redirect("/auth")
}
return (
@@ -28,7 +28,7 @@ function SubmitButton() {
}
export default function LoginPage() {
export default function AuthPage() {
const [state, formAction] = useActionState(login, undefined);
return (
+2 -2
View File
@@ -6,7 +6,7 @@ import db from '@/lib/db';
export const authConfig = {
pages: {
signIn: '/login',
signIn: '/auth',
},
providers: [
// The Credentials provider logic has been moved to src/auth.ts
@@ -21,7 +21,7 @@ export const authConfig = {
return isLoggedIn;
} else if (isLoggedIn) {
// Redirect logged-in users from the login page to the admin dashboard
if (nextUrl.pathname === '/login') {
if (nextUrl.pathname === '/auth') {
return Response.redirect(new URL('/admin', nextUrl));
}
return true;
+1 -1
View File
@@ -24,5 +24,5 @@ export async function login(
export async function logout() {
await signOut({ redirectTo: '/login' });
await signOut({ redirectTo: '/auth' });
}