0

In my angular application, user sign in through google firebase authentication account. I do not want to several users can sign in through the same account at the same times from different devices. What I expect is that when a user sign in in his device, other users will be automatically signed out from that account in their devices.

Can you tell me how can I do that?

lei lei
  • 1,753
  • 4
  • 19
  • 44
  • See some similar questions: https://stackoverflow.com/questions/48237439/firebase-authentication-limit-login-by-the-same-user, https://stackoverflow.com/questions/50700724/firebase-auth-login-must-allow-single-device-login, https://stackoverflow.com/questions/47751377/firebase-prevent-same-account-on-multiple-devices, https://stackoverflow.com/questions/55597523/firebase-username-password-authentication-allow-only-one-device-to-sign-in-at and probably a few more from this list: https://www.google.com/search?q=firebase+authentication+limit+to+single+device – Frank van Puffelen Nov 01 '19 at 13:05

1 Answers1

1

When you use Firebase Authentication in your app there is at most one signed-in user at once. If a new user signs into the app, any previous user is automatically signed out from the app.

If this doesn't work for you, I recommend that you update your question to include the minimal code that reproduces the behavior.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Thanks. I did a test in two devices, I logged in in one device and then logged in in another, both devices are work with the same account... – lei lei Nov 01 '19 at 12:35
  • Ah, I think I misunderstood and didn't notice you were talking about two devices. There is no connection as far as Firebase Authentication is concerned between the devices. As long as the user enters the correct credentials, they can sign in. – Frank van Puffelen Nov 01 '19 at 13:04
  • See some similar questions: https://stackoverflow.com/questions/48237439/firebase-authentication-limit-login-by-the-same-user, https://stackoverflow.com/questions/50700724/firebase-auth-login-must-allow-single-device-login, https://stackoverflow.com/questions/47751377/firebase-prevent-same-account-on-multiple-devices, https://stackoverflow.com/questions/55597523/firebase-username-password-authentication-allow-only-one-device-to-sign-in-at and probably a few more from this list: https://www.google.com/search?q=firebase+authentication+limit+to+single+device – Frank van Puffelen Nov 01 '19 at 13:05