Skip to content

Commit 9fe1991

Browse files
committed
added an addAcccount method
1 parent 5b907eb commit 9fe1991

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/OAuth2Client/NXOAuth2AccountStore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ typedef void(^NXOAuth2PreparedAuthorizationURLHandler)(NSURL *preparedURL);
124124
- (void)requestAccessToAccountWithType:(NSString *)accountType username:(NSString *)username password:(NSString *)password;
125125
- (void)requestAccessToAccountWithType:(NSString *)accountType assertionType:(NSURL *)assertionType assertion:(NSString *)assertion;
126126
- (void)requestClientCredentialsAccessWithType:(NSString *)accountType;
127+
- (void)addAccount:(NXOAuth2Account *)account;
127128
- (void)removeAccount:(NXOAuth2Account *)account;
128129

129130

Sources/OAuth2Client/NXOAuth2AccountStore.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,12 @@ - (void)oauthClientDidGetAccessToken:(NXOAuth2Client *)client;
470470
}
471471

472472
NXOAuth2Account *account = [[NXOAuth2Account alloc] initAccountWithOAuthClient:client accountType:accountType];
473+
474+
[self addAccount:account];
475+
}
476+
477+
- (void)addAccount:(NXOAuth2Account *)account;
478+
{
473479
@synchronized (self.accountsDict) {
474480
[self.accountsDict setValue:account forKey:account.identifier];
475481
[NXOAuth2AccountStore storeAccountsInDefaultKeychain:self.accountsDict];

0 commit comments

Comments
 (0)