- fix
This commit is contained in:
parent
36a361d021
commit
bdae7ebd76
@ -63,7 +63,7 @@
|
||||
|
||||
} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
|
||||
if (retries > 0) {
|
||||
[[PNObjectConfig sharedInstance] refreshTokenWithBlockSuccess:^(BOOL refreshSuccess) {
|
||||
[[PNObjectConfig sharedInstance] refreshTokenForOauthMode:oauthMode retries:MAX_RETRIES WithBlockSuccess:^(BOOL refreshSuccess) {
|
||||
|
||||
return [self POSTWithEndpointAction:endPoint parameters:parameters retries:retries-1 progress:uploadProgress success:success failure:failure];
|
||||
} failure:^(NSError * _Nonnull error) {
|
||||
|
||||
@ -876,7 +876,7 @@ static bool isFirstAccess = YES;
|
||||
- (BOOL) setCredentialTokenForOauthMode:(OAuthMode) oauthMode {
|
||||
switch (oauthMode) {
|
||||
case OAuthModeClientCredential:
|
||||
if (_currentOauthClientCredential && ![_currentOauthClientCredential isExpired]) {
|
||||
if (!_currentOauthClientCredential || (_currentOauthClientCredential && ![_currentOauthClientCredential isExpired])) {
|
||||
return NO;
|
||||
}
|
||||
[_managerHttpRequestSerializer setAuthorizationHeaderFieldWithCredential:_currentOauthClientCredential];
|
||||
@ -884,7 +884,7 @@ static bool isFirstAccess = YES;
|
||||
[_manager.requestSerializer setAuthorizationHeaderFieldWithCredential:_currentOauthClientCredential];
|
||||
break;
|
||||
case OAuthModePassword:
|
||||
if (_currentOauthUserCredential && ![_currentOauthUserCredential isExpired]) {
|
||||
if (!_currentOauthClientCredential || (_currentOauthUserCredential && ![_currentOauthUserCredential isExpired])) {
|
||||
return NO;
|
||||
}
|
||||
[_managerHttpRequestSerializer setAuthorizationHeaderFieldWithCredential:_currentOauthUserCredential];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user