How can I get nextauth session data in a server component?
I’d like to get the session data inside the /protected/page.tsx but I’m getting null, How can I solve this? Is it possible to get it even if it’s a server component?
How to implement two-factor authentication (2FA) using NextAuth.js with email OTP?
I have created an app and successfully implemented a simple signup and signin using NextAuth.
Token not coming – nextjs auth
import { NextAuthOptions } from ‘next-auth’; import CredentialsProvider from ‘next-auth/providers/credentials’; import bcrypt from ‘bcryptjs’; import dbConnect from ‘@/lib/dbConnect’; import UserModel from ‘@/model/User’; export const authOptions: NextAuthOptions = { providers: [ CredentialsProvider({ id: ‘credentials’, name: ‘Credentials’, type: ‘credentials’, credentials: { email: { label: ‘Email’, type: ‘text’ }, password: { label: ‘Password’, type: ‘password’ }, }, async […]
Why do I get a nested URL of ‘/auth/auth/ ‘ if the URL is not existing?
so I was following a tutorial and somehow stuck in a problem wherein if the URL is not existing in the routes.ts
. It redirects to a nested /auth/auth/...../login/
instead of redirecting it to localhost:3000/auth/login