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

Need to differentiate login callback credentials from google and facebook using next-auth

I am getting data successfully from google and facebook login using next-auth. I want to save separate profiles for Google and Facebook as well. Data I am getting is name, image, email and session expiry but I need to differentiate the callback…
0
votes
0 answers

How do i get the GitHub username for signed in user, with GitHub auth

I am using Next Auth and Prisma adaptor but the user information i get is just there email and name, not there actual github username or any other type of info, this is what the prisma schema looks like datasource db { provider =…
user18371666
  • 71
  • 1
  • 8
0
votes
0 answers

nextAuth unstable_getsession and getToken returning null not working correctly

when i use useSession in my front next app everything is okey i can get the user loged in but when i try to use getToken or unstable_getSession in my api it always returns null im trying to use unstable_getsession to check if a user is loged in to…
0
votes
1 answer

Does Next-Auth allow for users who sign in through socials to get a unique username?

While I would like to implement both a regular username and password sign in, I would also like to allow users to signup/signin with a social account like Google. I am planning on using NextAuth If they sign up with Google, is there a way to make…
user19686218
0
votes
1 answer

How do I read session properties using useSession() in getServerSideProps() using nextjs and next-auth?

I am trying to only show data where the "Heading" is the same as the logged-in user's name. I'm using Next.js and I'm trying to server render the data from my Prisma database, but when I try to filter the data to only show "Segments" where the…
0
votes
1 answer

Invalid User Data Pusher Next JS

Hey guys recently I am practicing pusher with next js but I stumbled upon this problem where it says Error: Invalid user data: 'presence-channel' and i cannot seem to fix it no matter how many times i try can someone help me with pointing out where…
Swikar
  • 15
  • 3
0
votes
1 answer

Keycloak provider for Next-Auth doesn't work

I can't understand why my next-auth integration with Keycloak server fails while the integration with Github works. import NextAuth from "next-auth" import KeycloakProvider from "next-auth/providers/keycloak"; import GitHubProvider from…
karalis1
  • 205
  • 1
  • 12
0
votes
0 answers

new window closing immediately after it opens up

hey folks I have written this code to open up the sign-in page from next-auth library in a new window using the react-new-window library but the problem with this code as soon as I click on the button the new window opens up and it immediately…
0
votes
1 answer

PUT method not working with my API, doesn't set to req.body

Here is the code for the PUT method: [/api/[id].ts] case "PUT": try { const user = await UserModel.findOneAndUpdate( { _id: id, }, { $set: req.body, } ); …
FSCYT
  • 104
  • 7
0
votes
2 answers

Does anyone know how I can get the user data in the return statement?

Code of Sword Component: import { useSession } from "next-auth/react"; import fetch from "isomorphic-unfetch"; const Sword = () => { const getUser = async () => { const { data: session } = await useSession(); const res = await fetch( …
FSCYT
  • 104
  • 7
0
votes
1 answer

How to set api routes if you want your NEXTJS app to follow a subdomain?

I have set up a NEXTJS app that is under a subdomain and basically the structure is the following: /Pages-> --/Sites --/api --/home --/subdomain_logic --_app.tsx ...config files... As of this moment, if you go to domain.com you will be landing into…
0
votes
1 answer

Next.js Build fails. window is not defined

I'm building a next.js app and it works perfect in development mode. While deploying to production it fails with the following error: [ ] info - Generating static pages…
Gaurish
  • 89
  • 2
  • 12
0
votes
1 answer

how to provide a secret to nextauth

i am using nextauth v:4.7.0, i didnt have a client secret and local environment worked well, after deploying to vercel, i was forced to provide a secret, from the code below export default NextAuth({ session: { // jwt: true, strategy:…
jeho Ntanda
  • 53
  • 1
  • 8
0
votes
2 answers

How to render data from parse in next-auth

I want to render data in client side below from parse after signin from next auth using useSession { objectId: 'nttMcKIOQJ', username: 'fiik346', email: 'fiik346@gmail.com', createdAt: '2022-06-26T07:56:41.888Z', updatedAt:…
0
votes
0 answers

Don't know how to get the discord user access_token, refresh_token and profile with the next-auth

hey folks I have written this next-auth function to enable discord authentication in my webpage import NextAuth from 'next-auth/next'; import DiscordProvider from 'next-auth/providers/discord'; export default NextAuth({ providers: [ …