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

pop up window immediately closing as soon after the window open after clicking the button

hey folks can anyone check my code because when I click on the login button new window opens up and immediately it closes I don't what the problem is I'm using import NewWindow from 'react-new-window'; const [newWindow, setnewWindow] =…
0
votes
0 answers

Client fetch error next-auth NEXT.js and Vercel deploy with custom domain

I have an e-commerce that I deploy into vercel, I used next-auth for authentication, when i try to login it's complains and launch an error [nextauth].ts export default NextAuth({ providers: [ Credentials({ name: "Custom Login", …
0
votes
1 answer

don't know how to open the next-auth signIn in new window

Hey folks I have imported signIN() from the import { signIn } from 'next-auth/react'; and I'm using it like this but the problem with this setup is that the authentication link opens up in…
0
votes
0 answers

NextAuth + AWS Cognito - message: 'nonce mismatch, expected undefined, got:

I'm using nextjs 12.1.6, nextauth ^4.5.0, cognito to create social sign ins. After successful sign in on the cognito Hosted UI, I get redirected to my nextjs app with this error in the url api/auth/signin?error=OAuthCallback. I'm not sure what the…
0
votes
1 answer

I cant set my cookie in nextjs. Error : Cannot read properties of null (reading 'useContext')

There is no error in next-auth implementation, i just want to set the cookie, but couldn't understand how to do. auth.js import { useCookies } from "react-cookie"; import { setCookies } from 'cookies-next'; import { useEffect } from "react"; const…
NRA 1
  • 137
  • 1
  • 1
  • 10
0
votes
1 answer

Unable to get user image from Spotify API session

I am trying to build a clone to Spotify App using their API and I only seem to be getting name , email and username from the API. Is there a way to get profile picture details? Appreciate the responses.
Sri Lekha
  • 1
  • 2
0
votes
1 answer

NextJS next-auth get session always null

Can't get the session data using getSession({req}) on a api call? useSession() on a component is working fine. package versions: nextjs@12.01, next-auth@4.3.1 issue: api/lists.ts: import prisma from "../../../lib/prisma"; import { getSession } from…
DPP
  • 12,716
  • 3
  • 49
  • 46
0
votes
2 answers

Unexpected token S in JSON at position 0' Next auth

A teammate and I are working developing an application portal. We have the same exact code, node version and environment variables but when he logs in, he gets this error. I am able to login perfectly without any error. He was also able to login…
Judy Zhang
  • 11
  • 1
  • 2
0
votes
1 answer

How to add multi-tenancy using Next Auth and Keycloak provider

I've been trying to use next-auth and keycloak together, but I'm falling when using multi-realms login, using a single keycloak provider I couldn't change clientSecret and issuer options at runtime, so I tried to add multiples keycloak providers…
Jonas Cerqueira
  • 160
  • 2
  • 8
0
votes
0 answers

Next Auth continues to give "[next-auth][warn][NO_SECRET] https://next-auth.js.org/warnings#no_secret"

I am using Next-Auth in a next js website I am building. I have defined this in my .env NEXTAUTH_URL=http://localhost:3000 NEXTAUTH_SECRET=[secret] however I am still getting the no secret warning every time I login. Does anyone know why this might…
0
votes
1 answer

POST request issues to Twitter API

I have been using NextJS, Twitter-lite to build an application using the twitter app, I basically am trying to implement the functionality in which users can post a tweet from the app to their twitter accounts. I have also used Next-Auth for…
Kentrell Jr
  • 197
  • 1
  • 15
0
votes
1 answer

Using Next Auth to silent log in users with external tokens from AWS Cognito

We have a website where users authenticate themselves using AWS Cognito. That has been implemented using Next Auth with the Cognito provider based of their example code. That is working fine. However, whenever a new potential lead (customer) fills…
enesse
  • 13
  • 2
0
votes
0 answers

Email provider: How to preserve value in `signIn` callback between sending email and verification calls?

I want to implement role based authentication in my app. After researching for a while I found a simple solution - to pass role to signIn function signIn('email', { email, role: 'user' }); Then I can unpack it from req's body import NextAuth from…
0
votes
2 answers

oauth with next-auth ans Okta not working

I'm trying to provide SSO to a next.js app with Okta but it's not working and I don't know why. Worked perfect;y with Google. I get the error: [next-auth][error][GET_AUTHORIZATION_URL_ERROR] …
0
votes
1 answer

How to solve Vercel 500 Internal Server Error?

I have created a project that uses MongoDB to store user info and Next-Auth to authenticate users. On local host this is all working seamlessly. Previously I had a couple errors with my next-auth config, but that seems to be working fine now on…
Felipe
  • 333
  • 7
  • 19