Skip to content

Commit 8088832

Browse files
address comments
1 parent 2c5e437 commit 8088832

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Auth0/CredentialsManager.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,9 @@ public struct CredentialsManager: Sendable {
803803
callback(.success(newCredentials))
804804
}
805805
case .failure(let error):
806+
complete()
806807
// Check if we should retry based on error type and retry count
807808
if self.shouldRetryRenewal(for: error, retryCount: retryCount) {
808-
complete()
809809
// Calculate exponential backoff delay: 0.5s, 1s, 2s, etc.
810810
let delay = pow(2.0, Double(retryCount)) * 0.5
811811
DispatchQueue.global(qos: .utility).asyncAfter(deadline: .now() + delay) {
@@ -818,7 +818,6 @@ public struct CredentialsManager: Sendable {
818818
callback: callback)
819819
}
820820
} else {
821-
complete()
822821
callback(.failure(CredentialsManagerError(code: .renewFailed, cause: error)))
823822
}
824823
}

EXAMPLES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ When a renewal request fails due to a transient error, the Credentials Manager w
499499
1. Request A calls `credentials()` and starts a token refresh
500500
2. Request A successfully hits the server and gets new credentials
501501
3. Request A fails on the way back (network issue), never reaching the client
502-
4. Later, request B retries with the same (old) refresh token
502+
4. The retry mechanism automatically retries the failed request using the same (old) refresh token
503503

504504
To fully leverage the retry mechanism, ensure your Auth0 tenant's **Rotation Overlap Period** is set to at least 180 seconds. This overlap window ensures the old refresh token remains valid during retry attempts even if the backend resource was already updated. You can configure this setting in your Auth0 Dashboard under **Applications > [Your Application] > Settings > Refresh Token Rotation**.
505505

0 commit comments

Comments
 (0)