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

Does next-auth use passport.js under the hood?

I am trying to understand how next-auth works. Does next-auth use passport.js under the hood? With added features or abstraction?
YulePale
  • 6,688
  • 16
  • 46
  • 95
0
votes
0 answers

Can I use oAuth2 with JWT?

I'm kind of new with oAuth2. I just want to ask if is it possible to use it together with JWT. I'm currently using NextJS for front end and NestJS for backend. For front end i'm using next-auth and for backend i'm using passport jwt strategy. I'm…
Rey
  • 3
  • 1
0
votes
1 answer

next-auth FirestoreAdapter not connecting to backend

I am trying to implement the next-auth to authenticate and store user details through #GoogleProvider. For some reason, the app is not connecting to the backend. I changed the firestore security rules to all, but the problem…
LonelySoul
  • 1,212
  • 5
  • 18
  • 45
0
votes
1 answer

Next.js - TypeError: Cannot convert undefined or null to object

I'm getting this 'TypeError: Cannot convert undefined or null to object' error when trying to run my project locally (screenshot below). I have tried updating all the packages in the package.json. I've tried deleting the node modules and…
0
votes
1 answer

NextAuth Callbacks Not Running

I'm designing an application with Next.js and using NextAuth for authentication(using Google OAuth). In order to use other Google APIs once authenticated, I want to persist the accessToken. The accessToken gets set in the session() callback.…
0
votes
1 answer

Unexpected behaviour of logging errors in console using Next-Auth

I am making a Next.js app with Next-auth.js authentication. The app is deployed on vercel. When I tried to open my app, it shows error in console. Here is the list of errors: Failed to load resource: the server responded with a status of 500…
0
votes
0 answers

Failing to add CredentialsProvider on Next-Auth in Nextacular

ok so I have been banging my head against the wall for 4 days now and I'm failing to use the Credentials Provider of Next-Auth in nextacular. I have made that work on other small test demos but failed to do so on Nextacular. Even after inserting the…
Osama Ehsan
  • 33
  • 2
  • 4
0
votes
0 answers

How to make NextAuth update the User on a role change?

I'm using NextAuth with the Prisma adapter and AWS Cognito and it works perfectly, but my problem is that my User model doesn't get updated if I change the groups on Cognito. This is how I configured NextAuth: // I copied the original and changed…
Adam Arold
  • 29,285
  • 22
  • 112
  • 207
0
votes
0 answers

getSession always retrives null inside API route - next auth v4

I'm developing a integration with stripe in my nextjs aplication. Currently I'm trying to redirect the user to the checkout process, however, for that I need to get the session information in my 'subscribe.ts' file inside /pages/api. I'm using…
0
votes
0 answers

getCsrfToken stopping custom signin page to load

I am using the Credentials to sign in with nextauth-react. I have the following sign in page (taken from their website): import { getCsrfToken } from "next-auth/react" export default function SignIn({ csrfToken }) { console.log(csrfToken) …
Richard Bridge
  • 318
  • 1
  • 3
  • 10
0
votes
1 answer

How to protect specific route in next-auth

I'm building a simple client app with react and next-auth. I want to protect only one route /secret and the rest of routes are all publicly accessible. The top level of app is wrapped with SessionProvider: import { SessionProvider } from…
doobean
  • 1,929
  • 4
  • 19
  • 27
0
votes
1 answer

Next-Auth Firebase Implementation for Authentication

Would like to use #next-auth for authentication with Google provider and use firebase as the storage for user and session data. Getting the following error , while implementing the setup. Error Server Error SyntaxError: Cannot use import statement…
LonelySoul
  • 1,212
  • 5
  • 18
  • 45
0
votes
0 answers

Setting a global user state once, with ID returned from useSession hook with NEXT NEXT-AUTH

I have build my authentication system with next-auth. The data object returned from the useSessionhook returns the ID, that I then need to pass into a fetchUser function, so that I may acquire the user details and set that to a global state so the…
Ben_Sven_Ten
  • 529
  • 3
  • 21
0
votes
0 answers

Property "auth" does on exist on type 'FC<{}>' when using next/auth and useSession

I have what is essentially some boilerplate code from the next/auth docs in my _app.tsx file type CustomAppProps = AppProps & { Component: NextComponentType & { auth?: boolean } pageProps: { session: Session } } function MyApp({ …
Ben_Sven_Ten
  • 529
  • 3
  • 21
0
votes
1 answer

Next.js / NextAuth: Why can't I access session in API route

I'm new to Next.js and even newer to NextAuth, so I may be missing something obvious. I'm using the next-auth email provider as a magic link. I am able to authenticate and redirect. I can see the cookies in the Application tab of the Chrome dev…
Neil Girardi
  • 4,533
  • 1
  • 28
  • 45