[英]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.