Skip to content

Commit 440ee4e

Browse files
author
“Akshay
committed
[MOB-7857] - Add user logged in check
Prevents jwt refesh being called if user is logged out within the scheduled time
1 parent b8964cb commit 440ee4e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

swift-sdk/Internal/AuthManager.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,11 @@ class AuthManager: IterableAuthManagerProtocol {
142142
ITBInfo()
143143

144144
expirationRefreshTimer = Timer.scheduledTimer(withTimeInterval: interval, repeats: false) { [weak self] _ in
145-
self?.requestNewAuthToken(hasFailedPriorAuth: false)
145+
if(self?.localStorage.email != nil && self?.localStorage.userId != nil) {
146+
self?.requestNewAuthToken(hasFailedPriorAuth: false)
147+
} else {
148+
ITBDebug("Email or userId is not available. Skipping token refresh")
149+
}
146150
}
147151
}
148152

0 commit comments

Comments
 (0)