【问题标题】:How to solve this Connection GRPC Stream Error while trying to implement Authenticaton using Next-Auth with Firebase-Adapter如何在尝试使用 Next-Auth 和 Firebase-Adapter 实现身份验证时解决此连接 GRPC 流错误
【发布时间】:2023-01-04 19:54:13
【问题描述】:

我正在尝试使用以 firebase 作为后端的 next-auth 对用户进行身份验证。

这是我的 [...nextauth].js 文件

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

export default NextAuth({
  providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_ID,
      clientSecret: process.env.GOOGLE_SECRET,
    }),
  ],
  adapter: FirestoreAdapter({
    apiKey: process.env.FIREBASE_API_KEY,
    appId: process.env.FIREBASE_APP_ID,
    authDomain: process.env.FIREBASE_AUTH_DOMAIN,
    databaseURL: process.env.FIREBASE_DATABASE_URL,
    projectId: process.env.FIREBASE_PROJECT_ID,
    storageBucket: process.env.FIREBASE_STORAGE_BUCKET,
    messagingSenderId: process.env.FIREBASE_MESSAGING_SENDER_ID,
    emulator: {},
  }),
})

表明登录 - Google 帐户页面,然后当我选择一个谷歌帐户时,它只是保持加载状态,它在终端中显示没有建立连接错误。

下面是一张完美描述错误的图片。

Connection GRPC Stream error. Code: 14 Message: 14 UNAVAILABLE: No Connection established

【问题讨论】:

    标签: firebase google-cloud-firestore next.js next-auth


    【解决方案1】:

    发生这种情况是因为 FirestoreAdapter 中的模拟器对象为空。删除它应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 2019-04-18
      • 2021-05-24
      • 2022-10-13
      • 2021-12-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多