Next.js Discord

Discord Forum

Next Auth Credentials Provider

Unanswered
Harlequin posted this in #help-forum
Open in Discord
HarlequinOP
Title: Issue with NextAuth.js: "Something Went Wrong" Error After Redirect to Dashboard

Body:

I'm encountering an issue with my Next.js application where, after signing in, the user is redirected to the dashboard, but the page requires a full reload and throws a "Something Went Wrong" error. Here's the setup I'm using:

Auth Setup (next-auth.js):


Problem:

After logging in, the user is correctly redirected to the /dashboard, but the page requires a full reload and sometimes throws a "Something Went Wrong" error. This only happens after the redirect. How can I fix this issue and prevent the page from requiring a full reload?

Things I've Tried:

Debugging the authorized callback to ensure it's working correctly.
Checking the middleware configuration.
Environment:

I'm using JWT strategy for sessions, and the signIn page is set to /. The middleware is configured to match all routes except for those related to api, _next, and favicon.ico.

1 Reply

Original message was deleted
HarlequinOP
ok