Skip to content

How does remember me works in Next Auth #9255

Closed Answered by Huzaifahimran
jpcchaves asked this question in Help
Discussion options

You must be logged in to vote

I have forged a solution for this

authOptions.ts

import { NextAuthOptions } from "next-auth";
import GoogleProvider from "next-auth/providers/google";
import CredentialsProvider from "next-auth/providers/credentials";
import bcrypt from "bcryptjs";
import { getUserByEmail } from "../utils/tables/Auth_user";

export const authOptions: NextAuthOptions = {
  providers: [
    GoogleProvider({
      clientId: process.env["GOOGLE_ID"] as string,
      clientSecret: process.env["GOOGLE_SECRET"] as string,
    }),
    CredentialsProvider({
      credentials: {
        email: { label: "Email", type: "text" },
        password: { label: "Password", type: "password" },
        rememberMe: { label: …

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
4 replies
@jpcchaves
Comment options

@jpcchaves
Comment options

@jpcchaves
Comment options

@stabla
Comment options

Comment options

You must be logged in to vote
6 replies
@Huzaifahimran
Comment options

@jcyuan
Comment options

@jcyuan
Comment options

@jcyuan
Comment options

@PhilippLeh
Comment options

Answer selected by jpcchaves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
6 participants