Skip to content

Commit ed1abee

Browse files
pszalkototo
authored andcommitted
Fixed assertion issue when refresh_token is not used and access_token is expired.
1 parent 55bd472 commit ed1abee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/OAuth2Client/NXOAuth2Connection.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ - (NSURLConnection *)createConnection;
169169
// if token is expired don't bother starting this connection.
170170
NSDate *tenSecondsAgo = [NSDate dateWithTimeIntervalSinceNow:(-10)];
171171
NSDate *tokenExpiresAt = client.accessToken.expiresAt;
172-
if ([tenSecondsAgo earlierDate:tokenExpiresAt] == tokenExpiresAt) {
172+
if (nil != client.accessToken.refreshToken && [tenSecondsAgo earlierDate:tokenExpiresAt] == tokenExpiresAt) {
173173
[self cancel];
174174
[client refreshAccessTokenAndRetryConnection:self];
175175
return nil;

0 commit comments

Comments
 (0)