16 lines
313 B
TypeScript
16 lines
313 B
TypeScript
// middleware.ts
|
|
import { withAuth } from 'next-auth/middleware';
|
|
|
|
export default withAuth({
|
|
callbacks: {
|
|
authorized: ({ token }) => Boolean(token),
|
|
},
|
|
pages: {
|
|
signIn: '/',
|
|
},
|
|
});
|
|
|
|
export const config = {
|
|
matcher: ['/((?!auth|browser|telegram|api|_next/static|_next/image|favicon.ico).*)'],
|
|
};
|