Relative Content

Tag Archive for next.jsnext-auth

location.reload() sends me to previous page in Next.js 14

I have an app that sends user to main page after login.On the main page I have a navbar that displays “Log in” or user’s name based on the state of the user’s log in status.To refresh the state in the navbar component i call

Accessing OAuth 2.0 Token Set in Next.js with NextAuth.js

I’m working on a Next.js project that uses a custom API service with OAuth 2.0 authentication. The authentication is managed with NextAuth.js (v5). I’ve implemented credential-based authentication and it works, but I’m having issues accessing the OAuth 2.0 token set on individual pages and updating it upon token refresh.

Next Auth v5, the Session data not updated after signing in. Middleware file not working as expected

I am new to NextAuth v5 and have been facing a lot of bugs.
1: After the user signed in, the session data is never updated unless I refresh the page (I had to force refresh using setTimeout)
2: I want to redirect signed-in users from /sign-in and /sign-up route via Middleware but it’s not working as expected.
I have been following the docs, asking the AI bot and watching youtube tutorials but still cannot fix this.

Next Auth Session not clearing in netlify

I am using next-auth(5.0.0-beta.18) for authentication in my application using credentials provider and deployed application on netlify. The issue is I am facing is when I signout and refresh It does not clearing session. All though its working fine on local and on vercel as well.