From f5c372a0c99a56ae7bafbd2bdb79b2d0545db8e8 Mon Sep 17 00:00:00 2001 From: Youssef Hanna Date: Fri, 10 Dec 2021 16:20:15 +0100 Subject: [PATCH 1/3] Create .DS_Store --- .DS_Store | Bin 0 -> 6148 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..65ac6810f255c42906a4ecc9f48f7818f312ba00 GIT binary patch literal 6148 zcmeHK%}T>S5T4Np0WbCDai2i!8zd#(g}#8a5sS1Why{;%CGin_0tFAgfY0GKKT3i* z6b~Y0rtEyPvoo9B54yWUL_FKpQ=$nG27-ZLpvM62Y?1ufFmx~w3?H Date: Fri, 10 Dec 2021 16:23:18 +0100 Subject: [PATCH 2/3] dispatch_async crash Fix when calling the perform from background thread, self not retained but if use blocks will be retained within the dispatch --- Source/AppAuthCore/OIDAuthState.m | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/AppAuthCore/OIDAuthState.m b/Source/AppAuthCore/OIDAuthState.m index fe8a16221..eaef49d3e 100644 --- a/Source/AppAuthCore/OIDAuthState.m +++ b/Source/AppAuthCore/OIDAuthState.m @@ -472,13 +472,17 @@ - (void)performActionWithFreshTokens:(OIDAuthStateAction)action (nullable NSDictionary *)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 From 477c1393ff0572ee0b09831d3ef6b560bec0fcfe Mon Sep 17 00:00:00 2001 From: Youssef Hanna Date: Fri, 10 Dec 2021 16:24:55 +0100 Subject: [PATCH 3/3] Delete .DS_Store --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 65ac6810f255c42906a4ecc9f48f7818f312ba00..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%}T>S5T4Np0WbCDai2i!8zd#(g}#8a5sS1Why{;%CGin_0tFAgfY0GKKT3i* z6b~Y0rtEyPvoo9B54yWUL_FKpQ=$nG27-ZLpvM62Y?1ufFmx~w3?H