Firebase: How to always force a sign-in?

谁说我不能喝 提交于 2020-01-24 10:09:12

问题


Working in Eclipse, & using the provided methods in Firebase' docs, I was able to setup logins for several providers such as Google and Facebook, using the redirect option. I basically click on a button for the provider on my web page, & it takes me to the login screen where I can enter a UID and password (e.g. Google sign-in)

However, once I authenticate properly with a valid account, and even if I sign-out, I get logged into the same account, without ever getting the screen prompting to log in. Where is this information persisted? Closing out Eclipse, or turning the computer off, does nothing to help, so I believe this is all being saved somewhere.

How do I "forget" previous attempts, so that I can see a provider's log in screen, each and every time?


回答1:


You can use setCustomParameters on AuthProviders. For example, in the case of Google: https://firebase.google.com/docs/reference/js/firebase.auth.GoogleAuthProvider#setCustomParameters

var provider = new firebase.auth.GoogleAuthProvider();
provider.setCustomParameters({prompt: 'select_account'});
firebase.auth().signInWithPopup(provider);

This will not forget the previous attempt but it will prompt the user to select an existing account or a new one.



来源:https://stackoverflow.com/questions/42992026/firebase-how-to-always-force-a-sign-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!