I'm using the firebase node api in my javascript files for Google login.
(我在我的JavaScript文件中使用firebase节点api进行Google登录。)
firebase.initializeApp(config);
let provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider);
This works fine and the user is able to login with his Google credentials.
(这可以正常工作,并且用户可以使用其Google凭据登录。)
When the user visits the page again, the popup opens again but since he has already logged in, the popup closes without requiring any interaction from the user.(当用户再次访问该页面时,弹出窗口会再次打开,但是由于他已经登录,因此该弹出窗口将关闭,而无需用户进行任何交互。)
Is there any way to check if there is already a logged in user before prompting the popup?(在提示弹出窗口之前,有什么方法可以检查是否已经有一个登录用户?)
ask by Jophin Joseph translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…