Next.js Discord

Discord Forum

Getting /api/auth/callback/credentials 302 signIn error dispite of correct credentials

Unanswered
Maltese posted this in #help-forum
Open in Discord
Avatar
MalteseOP
async session({session, user, token}) {
            session.user = token.user;
            session.jwt = token.jwt;
            return session;
        },
        async jwt({token, user}) {
            if(user) {
                token.user = user;
                token.jwt = user.jwt;
            }
            return token;
        },
        async signIn({ user, account, profile, email, credentials }) {
            return true
        },
        async redirect({ url, baseUrl }) {
        console.log("baseUrl", baseUrl);
        return baseUrl
        },

Code is reaching redirect method and baseUrl is printed but not anything else
Backend is also giving: [2024-07-27 12:14:31.409] http: POST /api/auth/local (1987 ms) 200
Next-app logs are as follows:
baseUrl http://localhost:3000
 GET /api/auth/signin 200 in 690ms
baseUrl http://localhost:3000
 POST /api/auth/callback/credentials 302 in 16ms
baseUrl http://localhost:3000
 GET /api/auth/error?error=CredentialsSignin&provider=credentials 302 in 6ms
baseUrl http://localhost:3000
 GET /api/auth/signin?error=CredentialsSignin 200 in 7ms

1 Reply