Search code examples
flutterflutter-dependenciesflutter-web

Login authentication like Netflix multiple users for same account in flutter


I'm creating an trading app in flutter Imagine that if an user account has an multiple login from different mobile devices if any one the user can change the account password how can I logout from all other user of different device

Or plz instruct me to create an logine authentication like instagram if an user logged in from another device change a password it will automatically logout from other device


Solution

  • The way I see this is that Firebase doesn't allow you to implement this functionality right now so you'll have to get creative with this by :

    1. Keep track of all the devices through name or IMEI from which logins of a particular user is happening

    2. Create a boolean isSignedOutAll for each and every user and check for this at startup

    3. Turn this to true if a user is clicking on Sign Out Of All Devices option

    4. Logout the user if isSignedOutAll is true on a particular device and then change it back to false for that particular device

    enter image description here

    This is the solution that I can think of now.