Next.js Discord

Discord Forum

redirect error vercel

Unanswered
Gazami crab posted this in #help-forum
Open in Discord
Avatar
Gazami crabOP
when i'm redirecting to page it always redirect me to the /home
this happens only on vercel, on my local development everything works fine
export default withAuth({
  callbacks: {
    authorized({ token }) {
      return !!token
    },
  },
  pages: {
    signIn: '/home',
    signOut: '/',
    error: '/',
  },
})

export const config = { matcher: [
    "/home",
    "/character/(.*)",
    "/admin/(.*)",
] }


this is my middleware.ts

3 Replies

Avatar
Gazami crabOP
Oct 02 12:00:41.48
-
[REDACTED]
[GET] /character/new
false
Oct 02 12:00:41.48
-
[REDACTED]
[GET] /character/new
null
Oct 02 12:00:41.48
-
[REDACTED]
[GET] /character/new
authorized
Oct 02 12:00:41.48
307
[REDACTED]
[GET] /character/new
[GET] [middleware: "src/middleware"] /
sometimes middleware token returns null
Avatar
Gazami crabOP
fixed