Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Source/AppAuthCore/OIDAuthState.m
Original file line number Diff line number Diff line change
Expand Up @@ -472,13 +472,17 @@ - (void)performActionWithFreshTokens:(OIDAuthStateAction)action
(nullable NSDictionary<NSString *, NSString *> *)additionalParameters
dispatchQueue:(dispatch_queue_t)dispatchQueue {

if ([self isTokenFresh]) {
// access token is valid within tolerance levels, perform action
dispatch_async(dispatchQueue, ^{
action(self.accessToken, self.idToken, nil);
});
return;
}
NSString * accessToken = self.accessToken;
NSString * idToken = self.idToken;
void (^block)(void) = ^(void){
action(accessToken, idToken, nil);
};

if ([self isTokenFresh]) {
// access token is valid within tolerance levels, perform action
dispatch_async(dispatchQueue, block);
return;
}

if (!_refreshToken) {
// no refresh token available and token has expired
Expand Down