小编Die*_*ruz的帖子

使用下一个身份验证时,Firebase 不会进行身份验证

我正在将 next-auth 与 firebase 适配器一起使用。在将用户保存到数据库方面一切工作正常,但在身份验证方面有些东西不起作用。

import NextAuth from "next-auth"

import GoogleProvider from "next-auth/providers/google"
import { FirebaseAdapter } from "@next-auth/firebase-adapter"

import { db } from "../../../utils/firebase/firebase"
import * as firestoreFunctions from 'firebase/firestore'

import { adminAuth } from "../../../utils/firebase/firebaseAdmin"

import { getAuth, signInWithCustomToken } from "firebase/auth"

const auth = getAuth()

export default NextAuth({
  providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_ID,
      clientSecret: process.env.GOOGLE_SECRET,
      state: false,
    }),
  ],
  adapter: FirebaseAdapter({
    db: db,
    ...firestoreFunctions,
  }),
  callbacks: {
    async signIn({ user, account, profile, email, credentials }) {
      console.log(user, …
Run Code Online (Sandbox Code Playgroud)

javascript firebase-authentication next.js next-auth

6
推荐指数
1
解决办法
5511
查看次数