-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Email verification only updates after clearing cache/app data #20
Comments
Also calling |
Definitely a firebase issue, need to try this on ios also, think it's just android with the problem. |
There is a sollution to this
performing both of these will trigger onAuthStateChanged with updated email without sign out. Only drawback is this won't happen automatically, so you need to provide some sort of screen that asks user to verify their email and has What I did is just deep link verification link into email and trigger those functions, that way it works as expected. @Ehesp |
@iljadaderko sounds good will give it a try! When the user registers I do an Alert with an OK action so I'll give it a go in there (and then on app reloads if it's still false). Could you explain/show a bit more on the deep linking? Not actually tried that yet. |
@Ehesp I use firebase's Dynamic links for this. Essentially you need to set up email verification to go to your custom page, where you then retrieve verification token and pass it to firebase manually, after this you can redirect to url that is set up in firebase as dynamic link, once app opens this url you can preform that token refresh automatically. I haven't done this myself but even better approach would be to have email verification link go straight into the app and validate user's token in there. On react native side, you'll be handling these as per following doc https://facebook.github.io/react-native/docs/linking.html#handling-deep-links |
@Ehesp @iljadaderko I could potentially add a native method that runs both reload and getToken(true) for this if needed? Something along the lines of |
@Salakar personally, I'd stick to calling these two methods as is, so you guys can keep your repo as close to firebase as possible. |
@Ehesp @iljadaderko in that case can I close this issue? Not much else I can do as its a firebase issue 🙈 |
@iljadaderko @Ehesp just for clarification Ideally I want this to happen:
But If the User decides to instead close the browser(ignoring the dynamic link) and launch my app again. I should keep track that previously verification email was sent, thus take the user to a screen (which shows whenever email is not verified and email has been sent). Upon this Screen mounting I ask User if they already verified their email , is so do some action. At this action run the above 2 methods? P.S this is only a problem for Android right? |
I tried the above solution yet I get the error below whenever I just login or signup a user:
After refresh with a user logged in the solution works. Why is it seeing the User as Null in my reload, which I surely trigger after authStateChanged has compleated? |
I faced the same prblm |
Same to me. And getToken method may be currently removed. addedI can use getIdtoken force and idTokenListener or onUserChanged instead. |
@tkow you have added a comment to a closed issue almost a year old, open a fresh issue with full information. I suspect this may be a need to update all the dependencies, because I have integrated firebase recently with current dependencies and this does not happen to me - I was able to use the sample code in the auth docs on rnfirebase.io and everything is fine. |
When creating an account and sending an email verification, after verifying the email address I can only get the
emailVerified
prop fromonAuthStateChanged
to return true after clearing the app data and logging in again.Only tested on Android at the moment.
The text was updated successfully, but these errors were encountered: