Skip to content

Commit 8800ca0

Browse files
committed
Updated iOS to include scopes in response
1 parent 291d2bf commit 8800ca0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

android/src/main/java/io/fullstack/oauth/OAuthManagerModule.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ private WritableMap accessTokenResponse(
483483
if (tokenType == null) {
484484
tokenType = "Bearer";
485485
}
486+
486487
String scope = accessToken.getScope();
487488
if (scope == null) {
488489
scope = (String) cfg.get("scopes");

ios/OAuthManager/OAuthManager.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,21 @@ - (NSDictionary *) getAccountResponse:(DCTAuthAccount *) account
567567
DCTOAuth2Credential *credential = account.credential;
568568
if (credential != nil) {
569569

570-
NSDictionary *cred = [self dictionaryForCredentialKeys: credential];
570+
NSMutableDictionary *cred = [self dictionaryForCredentialKeys: credential];
571+
572+
DCTOAuth2Account *oauth2Account = (DCTOAuth2Account *) account;
573+
if (oauth2Account.scopes) {
574+
[cred setObject:oauth2Account.scopes forKey:@"scopes"];
575+
}
576+
571577
[accountResponse setObject:cred forKey:@"credentials"];
572578
}
573579
}
574580
[accountResponse setValue:[account identifier] forKey:@"identifier"];
575581
if (account.userInfo != nil) {
576582
[accountResponse setObject:[account userInfo] forKey:@"user_info"];
577583
}
584+
578585
return accountResponse;
579586
}
580587

0 commit comments

Comments
 (0)