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]

1602 questions
0
votes
0 answers

Session callback with no value in NextAuth.js

Please can somebody help me with this issue in NextAuth.I am implementing authentication with CredentialsProvider in NextAuth. But I have a problem with a session callback. here is a bit of my code. After get a userdata from authorize. I am using…
Jules Betfien
  • 25
  • 2
  • 6
0
votes
1 answer

How to redirect back to protected page after Nextauth successful login?

I am using NextAuth for auth const options = { providers: [ EmailProvider({...}), ], pages: { signIn: SIGN_IN_URL, verifyRequest: AUTH_URL, }, callbacks: { async session(session) { return { ...session } }, …
grabury
  • 4,797
  • 14
  • 67
  • 125
0
votes
0 answers

next auth want to sync sign up with credentials email using the same email in google provider

hey i have a bug when i sign up with credentials in mongo i got the user schema after that if i log in with google provider with the same email i just have bag that returned me to the sign in page someone know how can i access the existing user and…
0
votes
0 answers

Nextjs cannot sign in with google at production build

When i try to sign in with google i'm getting this error from vercel's realtime logs 2022-10-06T23:09:23.609Z 75e67040-d28e-4d08-9004-9ccc239f9f18 ERROR [next-auth][error][SIGNIN_OAUTH_ERROR]…
José Carlos
  • 626
  • 3
  • 23
0
votes
0 answers

NextAuth (Email Provider): verify-request not called on first visit to page

I'm building an app with NextAuth's Email provider as the only method of login/authentication. Everything is working properly, except that users don't receive the login email when visiting the site for the first time (i.e. from a private browser…
DTX
  • 192
  • 1
  • 12
0
votes
2 answers

How to protect multiple routes from unauthorized access in Next.js using next-auth

I am using Next.js and I have a folder learning inside my pages folder. Now, this learning folder has about 10 pages. All these pages need to redirect to the index page if the user is not logged in. The following code does the job, but is there any…
Bilal Mohammad
  • 129
  • 1
  • 13
0
votes
0 answers

Nextjs Passportjs - Login creating a session entry in mongodb but no login

I have a sign in page and login using google api as well. Both show no errors and there is an entry created in the sessions collection but user is not logged in. Here is my signin page:
0
votes
0 answers

Next-auth , credentials provider, jwt token - Use token as bearer in authorization to api

Im currently building an app with Next.js and Next-auth with credentials provider. Im trying to understand how it would be possible to restrict my api's inside my pages folder, and somehow use the JWT token created by next-auth as bearer token in…
ScreamoIsDead
  • 157
  • 1
  • 1
  • 13
0
votes
0 answers

Furnishing user data in NextAuth EmailProvider and Fauna DB on signIn

I'm using NextAuth's EmailProvider and FaunaAdapter with a FaunaDB instance to authenticate users in my NextJS application. I'm going down the "passwordless" route with this site, and the magic links are setup nicely after finishing the bulk of this…
shennan
  • 10,798
  • 5
  • 44
  • 79
0
votes
1 answer

Why use next-auth with cognito? Why not just use aws cognito alone with nextjs?

Why would one use NextAuth.js with cognito is that not double work? Why not just use cognito alone?
YulePale
  • 6,688
  • 16
  • 46
  • 95
0
votes
0 answers

I cant install next-auth

next-auth@4.12.2: The engine "node" is incompatible with this module. Expected version "^12.19.0 || ^14.15.0 || ^16.13.0". Got "18.9.1"
Roshan Khatri
  • 89
  • 1
  • 2
0
votes
0 answers

NextJS getServerSideProps not supported when hosting the web

hi i am trying to hosting the dynamic web page. i use the getServerSideProps function to sign with google for everyone. but when i hosting the web there is a error with getServerSideProps. how can i fix it?? here is the signIn code including the…
0
votes
2 answers

How to make simple protected route using nextAuth?

I wanna make simple protected route. I have credentials provider and nextAuth middleware. I just wanna make simple logic: if user is logged in he can visit /profile, and if he visits /signup or /signin redirect him to /profile, and if he isnt…
mpoweredo
  • 79
  • 7
0
votes
1 answer

I tried to use next-auth in my nextJS App, but the error message says 'unable to verify the first certificate'

I tried to use next-auth to login with google , but it ran into an error and it said 'unable to verify the first certificate'.
YouYi
  • 23
  • 1
  • 6
0
votes
1 answer

NextAuth credentials provider and Strapi - User only has email

I'm trying to use NextAuth and Strapi in my app, but NextAuth session only shows email for the user. When I call the Strapi login API directly: axios .post(`${process.env.STRAPI_URL}/api/auth/local`, { identifier: "email@provider.com", …
Shahriar
  • 1,855
  • 2
  • 21
  • 45