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

Commit 9f3bf90

Browse files
committed
♻️ Reload when refreshing email verification status
1 parent 3163185 commit 9f3bf90

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Sources/EasyFirebase/Services/Auth/EasyUser.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,12 @@ public extension EasyUser {
362362
func refreshEmailVerifcationStatus() {
363363
guard assertAuthMatches() else { return }
364364
if let authUser = authUser {
365-
EasyAuth.emailVerified = authUser.isEmailVerified
366-
let id = authUser.providerData.first?.providerID ?? ""
367-
EasyAuth.accountProvider = EasyAuth.Provider(provider: id)
365+
authUser.reload(completion: { _ in
366+
guard let user = Auth.auth().currentUser else { return }
367+
EasyAuth.emailVerified = user.isEmailVerified
368+
let id = user.providerData.first?.providerID ?? ""
369+
EasyAuth.accountProvider = EasyAuth.Provider(provider: id)
370+
})
368371
}
369372
}
370373

0 commit comments

Comments
 (0)