Files
next-learn/dashboard/15-final/auth.config.ts
2023-10-14 00:28:44 +02:00

12 lines
292 B
TypeScript

import type { NextAuthConfig } from 'next-auth';
export default {
providers: [],
callbacks: {
authorized({ auth, request: { nextUrl } }) {
return !nextUrl.pathname.startsWith('/dashboard') || !!auth?.user;
},
},
pages: { signIn: '/login' },
} satisfies NextAuthConfig;