Firebase firestore not updating email verification status
It turns out that the token has to be refreshed as mentioned in the update above.
Here is how I solved my issue.
First I refresh the auth token
Auth.auth().currentUser?.getIDTokenForcingRefresh(true)
If that was successful, I then refresh the user.
Auth.auth().currentUser?.reload()
My issue was that I thought that reloading the user will refresh the token, I didn't imagine that things could be out of sync.
When I checked if the email was verified I got true
but the firestore database needs a refreshed token for it to know that the email was verified.
Verify email changes not reflected on same session in Firestore
await this.afAuth.auth.currentUser.reload();
before you try and access the account again
Firebase email verification not working as expected, without verification the user is able to login
you need to check on the firebase databasae for the field that says "is email verified" and then if that BOOL value is TRUE, then let them in the app. the bool value will turn to TRUE automatically after they click the link in their email. so instead of doing it like your'e doing, query the user table for that user and check the boolean value for whether they are verified, if they are not, then don't let them in. good luck and have a fabulous day
Firebase: do not create users until email is verified
One solution is to use Email Link authentication: the account will be created when the user completes the process.
Paul Ruiz (Firebaser) has written a complete article detailing how to implement this option: See the "Email Link (Passwordless Sign-In)" section.
FYI, the equivalent doc for the iOS and Android SDKs can be find here and here.
Related Topics
Delete All Characters After a Certain Character from a String in Swift
Input Type=File Not Working in Webview of Os X Application
How to Get Day and Month from Date Type - Swift 4
Masking Uiview/Uiimageview to Cutout Transparent Text
How to Make Alphabetically Section Headers in Table View with a Mutable Data Source
Read a File in a MACos Command Line Tool Project
Nsnumberformatter:Show 'K' Instead of ',000' in Large Numbers
Error Handling in Swift Does Not Involve Stack Unwinding. What Does It Mean
How to Connect Localhost (With Invalid Certificate) Using Alamofire
How to Set Uisegmentedcontrol Tint Color for Individual Segment
How to Append a Character to a String in Swift
Swift Protocol Generic as Function Return Type
Adjust Nsvisualeffectview Blur Radius and Transparency