Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Add support to reload firebase user #533

Merged
merged 1 commit into from
May 7, 2018

Conversation

imtoori
Copy link
Contributor

@imtoori imtoori commented May 4, 2018

currentUser() returns a cached instance of user. Using reload we can get a fresh instance

Copy link
Contributor

@collinjackson collinjackson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like developers would want the data of the currentUser() object to change after reload() completes, rather than having to call currentUser() again to get the new data. Perhaps rather than being immutable, currentUser should be a singleton that can be mutated by reload(), as well as the other sign in methods. What do you think?

@imtoori
Copy link
Contributor Author

imtoori commented May 4, 2018

That is a clever suggestion, but I took a look at android sdk implementation and it works in that way. https://stackoverflow.com/questions/41488726/get-updated-user-from-firebase-authentication (the first answer)
Also iOS sdk works like that https://stackoverflow.com/questions/47126463/auth-auth-currentuser-reload-doesnt-refresh-currentuser-isemailverified (the first answer again)

@collinjackson
Copy link
Contributor

OK sounds good, let's match the Android and iOS functionality.

@collinjackson collinjackson merged commit fe87149 into flutter:master May 7, 2018
slightfoot pushed a commit to slightfoot/plugins that referenced this pull request Jun 5, 2018
julianscheel pushed a commit to jusst-engineering/plugins that referenced this pull request Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants