Skip to content

Commit 88f7b01

Browse files
committed
Remove credentials if refresh fails.
1 parent 9c974c8 commit 88f7b01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Source/Core/API/INPAuthHandler.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,17 @@ final class INPAuthHandler: RequestInterceptor {
7676
if !isRefreshing {
7777
refreshTokens { [weak self] (succeeded, accessToken, refreshToken) in
7878
guard let strongSelf = self else { return }
79-
strongSelf.requestToRetry.forEach { $0(.retryWithDelay(0.25)) }
79+
if succeeded {
80+
strongSelf.requestToRetry.forEach { $0(.retryWithDelay(0.25)) }
81+
} else {
82+
InPlayer.Account.removeCredentials()
83+
}
8084
strongSelf.requestToRetry.removeAll()
8185
}
8286
}
8387
}
88+
} else {
89+
return completion(.doNotRetry)
8490
}
8591
}
8692

0 commit comments

Comments
 (0)