File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,7 @@ - (void)oauthClientNeedsAuthentication:(NXOAuth2Client *)client;
485
485
#endif
486
486
}
487
487
488
- - (void )oauthClientDidGetAccessToken : (NXOAuth2Client *)client ;
488
+ - (void )oauthClientDidGetAccessToken : (NXOAuth2Client *)client
489
489
{
490
490
NSString *accountType;
491
491
@synchronized (self.pendingOAuthClients ) {
@@ -498,6 +498,31 @@ - (void)oauthClientDidGetAccessToken:(NXOAuth2Client *)client;
498
498
[self addAccount: account];
499
499
}
500
500
501
+ - (void )oauthClientDidRefreshAccessToken : (NXOAuth2Client *)client
502
+ {
503
+ NXOAuth2Account* foundAccount = nil ;
504
+
505
+ @synchronized (self.accountsDict )
506
+ {
507
+ for (NXOAuth2Account* account in self.accounts )
508
+ {
509
+ if (account.oauthClient == client)
510
+ {
511
+ foundAccount = account;
512
+ break ;
513
+ }
514
+ }
515
+ }
516
+
517
+ foundAccount.accessToken = client.accessToken ;
518
+ NSDictionary *userInfo = [NSDictionary dictionaryWithObject: foundAccount
519
+ forKey: NXOAuth2AccountStoreNewAccountUserInfoKey];
520
+
521
+ [[NSNotificationCenter defaultCenter ] postNotificationName: NXOAuth2AccountStoreAccountsDidChangeNotification
522
+ object: self
523
+ userInfo: userInfo];
524
+ }
525
+
501
526
- (void )addAccount : (NXOAuth2Account *)account ;
502
527
{
503
528
@synchronized (self.accountsDict ) {
You can’t perform that action at this time.
0 commit comments