Questions tagged [next-auth]
NextAuth.js is a open source authentication solution for Next.js applications. This tag is rarely used alone and is most often used in conjunction with [next.js]
2,293
questions
1
vote
0
answers
26
views
NextJS cookies not available client-side without a page refresh
I'm building an app using NextJS (app router system). I'm building the sign-up workflow, using NextAuth, and Resend. I'm using the newly available Resend provider from NextAuth.
Here is the workflow ...
0
votes
0
answers
16
views
Next Auth + Keycloak: how to log in into keycloak without popup
Next 14, next-auth v5.0.0-beta.19
I am trying to integrate keycloak into my app.
It works but when I enter my app credentials I have a keycloak popup which asks me keycloak credentials (that I have).
...
0
votes
0
answers
8
views
How can I implement jwt in my next js app using next auth with google provider as the first step to connect to a flask api?
I'm creating a web application that needs to consume a flask API. Authentication is initially done using next auth, but I would like the web application to consume a service from a route from my flask ...
0
votes
0
answers
22
views
Why won't my next.js credentials login with email and password work while my google provider authentication does?
I am trying to make a login page with Next Auth V4, and I have followed some instructions online that seems to work well for the google provider which works, but my "credentials" email and ...
1
vote
0
answers
15
views
Some users getting 431 error due to large JWT cookies, and Unexpected token < in JSON at position 0 on Vercel deployment
I'm encountering issues with authentication in my Next.js application using Next-auth. After deploying to Vercel, some users are unable to sign in, and the network error shows a 431: ...
0
votes
0
answers
8
views
Next Auth EmailProvider token type
I have a NextJS project and NextAuth EmailProvider implementaion,
There is custom adapter to put verification token in database:
createVerificationToken: (data) => {
return p.verificationToken....
0
votes
1
answer
21
views
Why session is undefined when I retrieve it in client side with useSession hook?
So this is my /login page.tsx page
"use client";
import React, { FormEvent, useEffect } from "react";
import { signIn, useSession } from "next-auth/react";
import { ...
0
votes
1
answer
29
views
Next-auth configuration redirection issue
I am using next-auth in nextjs for my authentication. After authentication with google provider, I am getting only a refresh and I need to manually enter the address I was navigated from to access it ...
0
votes
0
answers
11
views
Next Auth signout not working in vercel but ok in local
I am using nextAuth for signIn and signout.
My problem is that users can signIn properly (for example email:[email protected] pswd:0911111111), but can never signout in vercel, it will only redirect to ...
0
votes
0
answers
13
views
NextAuth Middleware Failing to Retrieve Token in Production
I'm using NextAuth in a Next.js application with a custom credentials provider. Everything works perfectly on my local development environment, but in production (deployed on Vercel), the middleware ...
0
votes
2
answers
26
views
Cannot login with OAuth discord provider from non-host device (Auth.js)
I am trying to simply test my web app from my phone (note: from a dev environment; not production) , but I cannot seem to login with my discord account on it. I have no problems signing in with my ...
0
votes
0
answers
18
views
NextJS with NextAuth.js custom API methods
I am making panel with NextAuth, and I wonder how can I use it in API routes?
I need to get users email or anything to work with database.
Documentation has only in NextJS "pages" API, but I ...
0
votes
1
answer
33
views
NextJS 14 AuthJS Social Provider Middleware - Add new user to MongoDB after JWT sign-in
I have a NextJS 14 app and have added AuthJS to allow users to login with social provider credentials only at this point via a custom signin page. I am using the JWT strategy in AuthJS to athenticate ...
0
votes
0
answers
48
views
next.js: useSession is not a function
I have a next.js project using next-auth and I've successfully set up login and now I'm trying to use the session to get userdata on a page but when I try to use useSession() I get
TypeError: (0 , ...
-1
votes
0
answers
38
views
The edge runtime does not support Node.js 'crypto' module error while adding mongoClient in Auth Js (Next js)
I have implemented auth js in the next js project. I also split the config like, auth.js and auth.config.js.
Now for the signIn functionality, if I add mongoClient to my auth.config.js, I am getting ...