37 questions
0
votes
0
answers
45
views
NextAuth (Auth.js v5 Beta) is building the callbackUrl using localhost:3000 in Production in Next.js v15.5
I have a Next.js v15.5 app directory frontend project with TypeScript and NextAuth v5 Beta. I have enabled the credentials provider from NextAuth, and everything works just fine locally, but in ...
0
votes
0
answers
38
views
How do I configure LinkedIn Provider from auth.js authentication library in my next.js 15 app router application?
To configure LinkedIn Provider from auth.js in my next.js 15 app, I followed instructions (including the links to LinkedIn docs) in auth.js under LinkedIn Provider. I registered an app in LinkedIn ...
3
votes
0
answers
261
views
Race Condition During Access Token Refresh with NextAuth.js v5 (Server-Side)
I'm encountering a race condition in my Next.js application (using NextAuth.js v5) when refreshing the access token. Multiple concurrent requests seem to trigger the token refresh logic simultaneously,...
0
votes
1
answer
75
views
Is it possible for authjs to refresh the auth token if I close the tab and return to my site in a new one?
I followed the guide for refresh token rotation and it is working for me. When I fetch the session from my Next frontend it does correctly refresh the token if needed. I've found, however, that if I ...
0
votes
0
answers
20
views
When deployed to the cloud, auth.js fails to refresh the access token seemingly at random
I followed the refresh token rotation JWT strategy on auth.js' website. My JWT is successfully refreshing when I'm developing locally. When I push it live to my Azure web service it also seems to work ...
0
votes
0
answers
66
views
How to Integrate Django Djoser Backend with Next.js Frontend Using Auth.js?
I am building authentication with:
Backend: Django (DRF) + Djoser for JWT authentication.
Frontend: Next.js using Auth.js (NextAuth) for authentication.
I want users to log in via Next.js, ...
0
votes
1
answer
759
views
How to implement a "return to previous page" after login in Next.js?
How to implement a "return to previous page" after login in Next.js?
I'm using nextjs v15 with app router, and I need functionality like when a user clicks a login button from any page, they ...
-1
votes
1
answer
128
views
NextJs - Console log is not logging in server
i am trying to make an auth in nextjs. and in the root middleware.ts i have this:
import { auth } from "./auth";
export default auth((req) => {
const isLoggedIn = !!req.auth;
...
0
votes
0
answers
61
views
Auth.js v5: Providers showing localhost:3000 instead of production domain when deployed to VPS with Dokploy
I'm having an issue with Auth.js (NextAuth) v5 in my Next.js application when deploying with Dokploy on my VPS server. The providers' URLs are showing localhost:3000 instead of my production domain.
...
-1
votes
1
answer
235
views
How to access numerical X (formerly Twitter) ID and/or handle during authentication with X?
I am using Auth.js in my NextJS 15 project to authenticate using X. Right now, my src/auth.ts is set up as follows:
import NextAuth from "next-auth"
import Twitter from "next-auth/...
-1
votes
1
answer
284
views
How can I programatically authenticate a user in Auth.js?
I have a Django application with authenticated (logged-in) users.
UPDATE: using the built-in django authentication.
I have another (Svelte) application using Auth.js (https://authjs.dev) for ...
0
votes
1
answer
295
views
How can I pass my session data (auth.js) to my pages.js and server components in my next.js app?
I'm using nextJs and Auth.js in my app. I used my header component to call await auth() to get the current session data of the user upon first signin in. My question is how can I passed that session ...
0
votes
1
answer
122
views
How do I persist NextAuthV5/Authjs login error to the front end?
I'm re-creating my app from PHP to Next.js using Auth.js - trying to follow this guide https://www.youtube.com/watch?v=1MTyCvS05V4&ab_channel=CodeWithAntonio
I am doing things a little differently ...
0
votes
1
answer
485
views
Auth.js v5: "Cannot read properties of undefined (reading 'name')" when calling auth()
I just followed the docs for Auth.js v5 to implement login via GitLab. I am using version 5.0.0-beta.21" (version 22 is broken).
The login goes well. But when I want to retreive my session info (...
2
votes
0
answers
206
views
Redirect Directly to OAuth Login in NextAuth.js Without Showing Sign-In Page
I am using NextAuth.js (Auth.js) in my Next.js 14 application with an OIDC provider for authentication.
I have implemented my own Oauth provider. I have implemented the following logic in my layout....
-1
votes
3
answers
763
views
Im not able to access my web client secret in firebase
im using auth.js for authentication system using google but im not able to access web client secret. It just shows me the placeholder I even controlled from inspect this page. Why im not able to get ...
2
votes
0
answers
383
views
NextAuth.js Subdomain Cookie Issue: Cookies Inaccessible on Subdomains
I'm working on implementing authentication using AuthJS (NextAuth) in a Next.js app. I want the session and CSRF cookies to be accessible across subdomains (e.g., *.localhost:3000) as well as the main ...
1
vote
1
answer
1k
views
UnhandledSchemeError with node:crypto when using @node-rs/argon2 in Next.js 14.2.6
I'm working on a Next.js project (version 14.2.6) and encountering an issue related to the @node-rs/argon2 package. The build process fails with an UnhandledSchemeError for the node:crypto module. The ...
0
votes
1
answer
2k
views
NextJs next-auth Microsoft Entra ID authentication issue
I have a NextJS 14 Project and try to integrate Microsoft Entra ID for authentication. Since my project has next-auth already I decided to follow the official document to implement the Microsoft Entra ...