mirror of
https://github.com/DerTyp7/f1r3wave-website.git
synced 2025-10-28 20:42:12 +01:00
21 lines
459 B
TypeScript
21 lines
459 B
TypeScript
import type { NextAuthConfig } from 'next-auth';
|
|
|
|
export const authConfig = {
|
|
pages: {
|
|
signIn: '/login',
|
|
},
|
|
callbacks: {
|
|
authorized({ auth, request: { nextUrl } }) {
|
|
const isLoggedIn = !!auth?.user;
|
|
|
|
const isOnAdminRoute = nextUrl.pathname.startsWith('/admin');
|
|
|
|
if (isOnAdminRoute) {
|
|
if (isLoggedIn) return true;
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
},
|
|
providers: [],
|
|
} satisfies NextAuthConfig; |