简体   繁体   English

Google firebase 首次登录时显示没有 email 选项

[英]Google firebase Sign-in show no email option on first sign-in

I'm using Google firebase v9.我正在使用谷歌 firebase v9。 On the first sign in, usually there would be a pop up for user to choose which email to sigh in with, but for some reason, when I sign in, it automatically send me to the chat page automatically.在第一次登录时,通常会有一个弹出窗口供用户选择与哪个 email 聊天,但由于某种原因,当我登录时,它会自动将我自动转到聊天页面。 I tried delete user in my firebase app and tried again and get the same result.我尝试在我的 firebase 应用程序中删除用户并再次尝试并获得相同的结果。 What am I doing wrong?我究竟做错了什么?

firebase.js: firebase.js:

 import { GoogleAuthProvider } from 'firebase/auth';
 import { initializeApp } from 'firebase/app';
 import { getAuth } from 'firebase/auth';

 const firebaseConfig = {//myap config};
 const app = initializeApp(firebaseConfig);
 const auth = getAuth(app);
 const provider = new GoogleAuthProvider();
 export { auth, provider };

login-page:登录页面:

import { auth, provider } from '../firebase';
import { useAuthState } from 'react-firebase-hooks/auth';
import { useNavigate } from 'react-router-dom';
import { signInWithPopup } from 'firebase/auth';

function Header(){
const [user] = useAuthState(auth);
const navigate = useNavigate();

const signIn = (e) => {
signInWithPopup(auth, provider)
.then(() => navigate('/channel'))
.catch((error) => alert(error.message));
};

return (
   <buttononClick={!user ? signIn : () => navigate('/channel')}>Login</button/>
  );
  };

Maybe It's because I am already sign-in on chrome?也许是因为我已经在 chrome 上登录了? If someone can check my code and verified, that would be awesome.如果有人可以检查我的代码并进行验证,那就太棒了。

It sounds like your app is already associated with your Google account.听起来您的应用已与您的 Google 帐户相关联。 Signing out does not sever that association.注销不会切断该关联。

Removing that association is described in the Remove third-party account access , but mostly consists of going to the list of Third-party apps with account access and removing your app from that list.删除该关联在删除第三方帐户访问中进行了描述,但主要包括转到具有帐户访问权限的第三方应用程序列表并从该列表中删除您的应用程序。


If that doesn't do it, have a look at the results on forcing the account picker to show up .如果不行,请查看强制显示帐户选择器的结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Firebase 使用email登录后google登录报错:密码无效或用户没有密码 - Firebase Sign-in with email after google sign-in has error : The password is invalid or the user does not have a password Firebase 自助登录问题 - Firebase self sign-in issue 获取谷歌登录的accessToken(安卓) - Obtaining accessToken for google sign-in (Android) Flutter Google 登录不工作平台异常 - Flutter Google Sign-In not working platformexception 我的 Flutter 应用程序中的 Google 登录失败 - Google sign-in is failing in my Flutter app 如何从 Firebase Apple 登录中获取 email 和全名? - How can I get email and full name from Firebase Apple sign-in? 如果应用仅使用 Google 登录 Firebase,如何为 Google Play 商店提供演示帐户? - How to provide demo account for Google Play Store if app uses only Google Sign-in Firebase? firebase 谷歌提供商登录覆盖其他登录提供商的理想解决方案 - Ideal solution for firebase google provider login overriding other sign-in providers 如何防止 Firebase 身份验证在首次登录时隐式创建新用户? - How to prevent Firebase Authentication creating a new user implicitly on first sign-in? 尝试为 Firebase 身份验证启用 Google 登录时出现“更新 Google 时出错”消息 - "Error updating Google" message when trying to enable Google Sign-In for Firebase Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM