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 {}
15981598 /// Retrieves the Firebase authentication token, possibly refreshing it if it has expired.
15991599 /// - Parameter forceRefresh
16001600 func internalGetTokenAsync( forceRefresh: Bool = false ) async throws -> String {
1601+ var keychainError = false
16011602 do {
16021603 let ( token, tokenUpdated) = try await tokenService. fetchAccessToken (
16031604 forcingRefresh: forceRefresh
16041605 )
16051606 if tokenUpdated {
16061607 if let error = updateKeychain ( ) {
1608+ keychainError = true
16071609 throw error
16081610 }
16091611 }
16101612 return token!
16111613 } catch {
1612- signOutIfTokenIsInvalid ( withError: error)
1614+ if !keychainError {
1615+ signOutIfTokenIsInvalid ( withError: error)
1616+ }
16131617 throw error
16141618 }
16151619 }
You can’t perform that action at this time.
0 commit comments