- Modified the middleware configuration to exclude the 'offer' path from the matcher, ensuring that requests to this route are handled appropriately.
18 lines
361 B
TypeScript
18 lines
361 B
TypeScript
// middleware.ts
|
|
import { withAuth } from 'next-auth/middleware';
|
|
|
|
export default withAuth({
|
|
callbacks: {
|
|
authorized: ({ token }) => Boolean(token?.telegramId),
|
|
},
|
|
pages: {
|
|
signIn: '/',
|
|
},
|
|
});
|
|
|
|
export const config = {
|
|
matcher: [
|
|
'/((?!auth|browser|telegram|unregistered|privacy|offer|api|_next/static|_next/image|favicon.ico).*)',
|
|
],
|
|
};
|