Properly log out a user from android app

后端 未结 6 1576
走了就别回头了
走了就别回头了 2020-12-17 08:46

I\'m developing a small android app, and basically so far it just has login and logout functionality. I\'m using Firebase to store user data and also for authentication.

6条回答
  •  渐次进展
    2020-12-17 09:19

    When Firebase authenticates the user (or you authenticate the user with Firebase), it stores the token for that user in local storage on your device. This happens when you call one of the authWith... methods (of course only if it successfully authenticates the user).

    Calling ref.unauth(); immediately deletes that token from local storage.

    A properly implemented flow would not automatically re-authenticate them when the user presses the back button, but that depends on the flow you implement (which is missing from your question and would likely be too much code anyway).

提交回复
热议问题