File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
FirebaseAuth/Sources/Swift/User Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1598,18 +1598,22 @@ extension User: NSSecureCoding {}
1598
1598
/// Retrieves the Firebase authentication token, possibly refreshing it if it has expired.
1599
1599
/// - Parameter forceRefresh
1600
1600
func internalGetTokenAsync( forceRefresh: Bool = false ) async throws -> String {
1601
+ var keychainError = false
1601
1602
do {
1602
1603
let ( token, tokenUpdated) = try await tokenService. fetchAccessToken (
1603
1604
forcingRefresh: forceRefresh
1604
1605
)
1605
1606
if tokenUpdated {
1606
1607
if let error = updateKeychain ( ) {
1608
+ keychainError = true
1607
1609
throw error
1608
1610
}
1609
1611
}
1610
1612
return token!
1611
1613
} catch {
1612
- signOutIfTokenIsInvalid ( withError: error)
1614
+ if !keychainError {
1615
+ signOutIfTokenIsInvalid ( withError: error)
1616
+ }
1613
1617
throw error
1614
1618
}
1615
1619
}
You can’t perform that action at this time.
0 commit comments