- fix expireDate in credential

This commit is contained in:
Giuseppe Nucifora 2018-03-28 12:27:44 +02:00
parent 7f4d30b205
commit 40afc59c8f
6 changed files with 13 additions and 14 deletions

View File

@ -33,15 +33,13 @@
// Override point for customization after application launch.
[PNObjectConfig initSharedInstanceForEnvironments:@{EnvironmentDevelopment : @{BaseUrl:@"http://pnobject.local/",EndpointPath:@"api/v1/"},
EnvironmentStage : @{BaseUrl:@"https://pnobject.stage.it/",EndpointPath:@"api/v1/"},
EnvironmentStage : @{BaseUrl:@"https://idd.ppreview.it/",EndpointPath:@"wp-json/"},
EnvironmentProduction : @{BaseUrl:@"http://pnobject.prod.it/",EndpointPath:@"api/v1/"},
} andUserSubclass:[PNUser class]];
/** Can user special char %@ to autoset EndpointPath to Oauth endpointPath */
[[PNObjectConfig sharedInstance] setClientID:@"******" clientSecret:@"******" oAuthEndpointAction:@"%@oauth-token" oauthMode:OAuthModeClientCredential refreshTokenEnabled:NO forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setClientID:@"******" clientSecret:@"******" oAuthEndpointAction:@"%@oauth-token" oauthMode:OAuthModePassword refreshTokenEnabled:NO forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setOauthUserName:@"admin" oauthPassword:@"admin" forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setClientID:@"xVdEbNLLierj9CJoLNo5lsbg7VFs8UikqADbcwKA" clientSecret:@"2WWSJrDNbZhbUUCXIOTBiYIJv9muiRGK68f2B2Eb" oAuthEndpointAction:@"oauth/token" oauthMode:OAuthModeClientCredential refreshTokenEnabled:NO forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setClientID:@"tXYhKtcvfYdCM4tNor6WfbclEWYkoGWqBimUBzqZ" clientSecret:@"3UMEQthBHp1oEo0pjFmgkifhig689ZL5L9DsSETd" oAuthEndpointAction:@"oauth/token" oauthMode:OAuthModePassword refreshTokenEnabled:YES forEnv:EnvironmentStage];
[[PNObjectConfig sharedInstance] setAcceptablePasswordLenght:8];
[[PNObjectConfig sharedInstance] setEnvironment:EnvironmentStage];

View File

@ -38,7 +38,7 @@ PODS:
- NSString-Helper (1.0.6)
- nv-ios-http-status (0.0.1)
- PEAR-FileManager-iOS (1.3.1)
- PNObject (2.4.1):
- PNObject (2.4.2):
- AFNetworking
- CodFis-Helper
- DDDKeychainWrapper
@ -85,7 +85,7 @@ SPEC CHECKSUMS:
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
PNObject: 5c3db798fbf278479377387882c73f980db4c30c
PNObject: 332e958cd11c9083abce467b0b93c84405a5c065
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66

View File

@ -1,6 +1,6 @@
{
"name": "PNObject",
"version": "2.4.1",
"version": "2.4.2",
"summary": "PNObject is a simple replica of the more complex ParseObject",
"homepage": "https://github.com/giuseppenucifora/PNObject",
"license": {
@ -12,7 +12,7 @@
},
"source": {
"git": "https://github.com/giuseppenucifora/PNObject.git",
"tag": "2.4.1"
"tag": "2.4.2"
},
"platforms": {
"ios": "8.0"

View File

@ -38,7 +38,7 @@ PODS:
- NSString-Helper (1.0.6)
- nv-ios-http-status (0.0.1)
- PEAR-FileManager-iOS (1.3.1)
- PNObject (2.4.1):
- PNObject (2.4.2):
- AFNetworking
- CodFis-Helper
- DDDKeychainWrapper
@ -85,7 +85,7 @@ SPEC CHECKSUMS:
NSString-Helper: 389265918b2a4c5b0d09f0e03c607e8e5e254dd7
nv-ios-http-status: b6c2b5fc8656cc19e0d3000dadce2080b99d0e2f
PEAR-FileManager-iOS: 3bc403f68a53483f5629aa822f4649e40275c4d3
PNObject: 5c3db798fbf278479377387882c73f980db4c30c
PNObject: 332e958cd11c9083abce467b0b93c84405a5c065
PureLayout: 4d550abe49a94f24c2808b9b95db9131685fe4cd
RZDataBinding: 6981e90ddaae2f5e02028323b1043f8c31013109
Specta: 3e1bd89c3517421982dc4d1c992503e48bd5fe66

View File

@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = 'PNObject'
s.version = '2.4.1'
s.version = '2.4.2'
s.summary = 'PNObject is a simple replica of the more complex ParseObject'

View File

@ -22,6 +22,7 @@
#import "AFOAuth2Manager.h"
#import "AFOAuthCredential.h"
#import "NSDate+NSDate_Util.h"
NSString * const kAFOAuthClientCredentialsGrantType = @"client_credentials";
NSString * const kAFOAuthPasswordCredentialsGrantType = @"password";
@ -275,7 +276,7 @@ static NSError * AFErrorFromRFC6749Section5_2Error(id object) {
NSDate *expireDate = [NSDate distantFuture];
id expiresIn = [responseObject valueForKey:@"expires_in"];
if (expiresIn && ![expiresIn isEqual:[NSNull null]]) {
expireDate = [NSDate dateWithTimeIntervalSinceNow:[expiresIn doubleValue]];
expireDate = [[NSDate date] dateByAddingMinutes:[expiresIn integerValue]/60];
}
if (expireDate) {