Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
♻️ Reload when refreshing email verification status
Browse files Browse the repository at this point in the history
  • Loading branch information
benlmyers committed May 1, 2022
1 parent 3163185 commit 9f3bf90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Binary file not shown.
9 changes: 6 additions & 3 deletions Sources/EasyFirebase/Services/Auth/EasyUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,12 @@ public extension EasyUser {
func refreshEmailVerifcationStatus() {
guard assertAuthMatches() else { return }
if let authUser = authUser {
EasyAuth.emailVerified = authUser.isEmailVerified
let id = authUser.providerData.first?.providerID ?? ""
EasyAuth.accountProvider = EasyAuth.Provider(provider: id)
authUser.reload(completion: { _ in
guard let user = Auth.auth().currentUser else { return }
EasyAuth.emailVerified = user.isEmailVerified
let id = user.providerData.first?.providerID ?? ""
EasyAuth.accountProvider = EasyAuth.Provider(provider: id)
})
}
}

Expand Down

0 comments on commit 9f3bf90

Please sign in to comment.