Stay logged in functionality with next auth
I want to implement a stay logged in functionality on a nextjs project. For authentication I am using next auth credentials provider. Any idea how to do that?
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
How can I prefetch the session of next auth globally? – with Nextjs page router
“Using NextAuth, I prefetch the session on the index.tsx page with SSR and inject it into _app.tsx. However, when refreshing the browser on other URLs, the session from NextAuth is not injected.”
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.
Auth.js (next-auth) callback on successful login
Is there any auth.js (next-auth) callback that is called after successful login (OAUTH, Magic Link, Credentials)? It can be used for keeping history of login activities, etc.
how to import Providers from next-auth?
My import statement:
Next-auth JWT/Session Callbacks returns access_token but in getServerSession() token is undefined
Currently, I’m implementing authentication in my NextJS app with the next-auth
package. I followed the documentation and created the /api/auth/[...nextauth]/route.js
file which has the following configuration
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.
AuthJS: Error on fetching session in Client Side Component
I’m facing the following issue: