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]
Questions tagged [next-auth]
1602 questions
0
votes
1 answer
Is it safe to use a connection string to access a resource within a webapp for Azure blobstorage and AD B2C
My webapp has secure Oauth 2.0 authentication with Azure AD B2C. Users have files stored in an Azure Blob Storage which they should be able to access in the web app. Do I need to create an API which the web app calls, providing the user's access…

Jonah Kornberg
- 153
- 1
- 8
0
votes
0 answers
Apollo GraphQL Explorer sign in to NextAuth
How do I sign in to NextAuth from the Apollo GraphQL Explorer? I can sign in to the regular website through /api/auth/signin, but I want to sign in in the GraphQL Explorer to see sessions and stuff.
I tried using the signIn() method from…

mathletedev
- 182
- 1
- 9
0
votes
0 answers
NextJS/ Firebase Next-auth TypeError: collection is not a function
This is a next.js web project and when I'm running it on a local server, it's showing a type error. I'm unable to understand what to do?
Can anyone kindly suggest me what to do?
///[...nextauth].js
import NextAuth from "next-auth";
import…
0
votes
1 answer
Prisma in Backend Directory or Frontend Directory?
Where's the right project directory to put Prisma ?
Backend Directory/Server or Frontend Directory/Server ?
Going for an Webapp with Nextjs, NextAuth(MagicLink), Prisma and PostgreSQL.
Every example that I see people use prisma inside Next folder…

gcapedro
- 33
- 4
0
votes
2 answers
attach accessToken using getSession from next-auth and @urql/exchange-auth
I'm using NextAuth for authentication and URQL's authExchange. The idea is to attach an accessToken in the Authorization header.
// ...
import { authExchange } from '@urql/exchange-auth'
import { getSession } from 'next-auth/react'
getAuth: async…

Stephan882
- 133
- 2
- 16
0
votes
0 answers
Next-auth prevent redirecting when credentials are incorrect
I'm building just an ordinary auth with next-auth Credentials. By default, Next-auth redirects to api/auth/signin?error=CredentialsSignin if credentials are incorrect. I'm using modal form to sign in and it can be opened in any existing page, so if…

A.Anvarbekov
- 955
- 1
- 7
- 21
0
votes
0 answers
Next.js - NextAuth throws error in Vercel
My next-auth works fine until a certain time.
But then, its throwing (The red session text in the picture above)
GET https://yazankasa-eng.vercel.app/api/auth/session 504 [next-auth][error][client_fetch_error]…

Ferhat Pektas
- 67
- 1
- 1
- 5
0
votes
1 answer
Using Mysql provider rather than MongoDB provider in Next.js (Next-auth)
I am new to Next.js framework and currently I am using Next-auth to be able to sign-up/login following the documentation.
So far everything is working fine and I used MongoDB provider listed in Next-auth documentation.
I am using SnedGrid to send an…

user2
- 59
- 1
- 11
0
votes
1 answer
Authorization Server policy requires PKCE to be used for this request
I'm using next-auth Hazelbase authentication service but when I'm deploying, it says Authorization Server policy requires PKCE to be used for this request.
Note: Hazelbase is also a service like sign in with google.
Logs Error…

Gulshan Aggarwal
- 954
- 1
- 7
- 13
0
votes
1 answer
next-auth 4 custom base path
I have an app that authenticates against Azure AD using next-auth 4.
It works fine and I can authenticate.
When I try to configure a custom base path http://localhost:3000/myapp for the app and call signIn() I get a 404 error telling me that…

Robert Hufsky
- 131
- 3
- 16
0
votes
0 answers
Next.js and Next Auth and fetch
So I am trying to develop the next app with a protected API route. When is simply use browser to call the API it response the output but when I use from client call It return null,
But when I do from client-side it returns null
Next Js client…

Mahafuz Zaman
- 95
- 1
- 1
- 5
0
votes
1 answer
TypeError: Cannot convert undefined or null to object - Typescript & Next.js
photo of error
I'm trying to render a button that will allow me to have login functionality. I am using Typescript and NextAuth. I have added a file for auth typings to try and solve the problem but for some reason, I am not able to use Object here…

ceindividual
- 1
- 1
0
votes
1 answer
Sign-in with Apple from device using NextAuth.js
When using the Apple provider with NextAuth.js on the web server and signing in on a native device app (written in Swift using ASAuthorizationAppleIDButton and ASAuthorizationAppleIDProvider) using Sign In With Apple, how do you add a new user and…

Edward Brey
- 40,302
- 20
- 199
- 253
0
votes
1 answer
Next-auth. Login User then what?
After I have logged in a user with next-auth, how I do fetch data using their information? Do I keep calling useSession or do something else? I want to fetch data on each page but this appears impossible become of the async nature of useSession() on…

421
- 203
- 1
- 5
- 13
0
votes
0 answers
How to create a middleware for the client side using nextauth in Next.js
What would be a proper middleware to protect the pages /admin if the user does not have a session?
Is it correct the name of the file "_middleware.js" and what should I write inside that file to protect the…

n9p4
- 304
- 8
- 34