Skip to content

Commit 7b9892b

Browse files
onSuccess in AuthManager should be called even when token is nil. Let the nil value be handled by the onSuccess handler which also takes nil token anyway.
1 parent 9978600 commit 7b9892b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

swift-sdk/Internal/AuthManager.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ class AuthManager: IterableAuthManagerProtocol {
9595

9696
queueAuthTokenExpirationRefresh(authToken)
9797

98-
if authToken != nil {
99-
onSuccess?(authToken)
100-
}
98+
onSuccess?(authToken)
10199
}
102100

103101
private func queueAuthTokenExpirationRefresh(_ authToken: String?) {

swift-sdk/Internal/InternalIterableAPI.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,10 @@ final class InternalIterableAPI: NSObject, PushTrackerProtocol, AuthProvider {
486486
}
487487

488488
private func requestNewAuthToken() {
489-
authManager.requestNewAuthToken(hasFailedPriorAuth: false, onSuccess: { [weak self] _ in
490-
self?.completeUserLogin()
489+
authManager.requestNewAuthToken(hasFailedPriorAuth: false, onSuccess: { [weak self] token in
490+
if token != nil {
491+
self?.completeUserLogin()
492+
}
491493
})
492494
}
493495

0 commit comments

Comments
 (0)