Skip to content

Commit c1fd721

Browse files
authored
Merge pull request #94 from MCaller/master
[fix]: for Google authentication make sure the clientID is present when performing authorization
2 parents 3fdcb4c + 1ae33ee commit c1fd721

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ios/OAuthManager/OAuthManager.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,9 @@ - (NSDictionary *) getConfigForProvider:(NSString *)name
294294
NSMutableDictionary *cfg = [[manager getConfigForProvider:providerName] mutableCopy];
295295

296296
DCTAuthAccount *existingAccount = [manager accountForProvider:providerName];
297-
if (existingAccount != nil) {
297+
NSString *clientID = ((DCTOAuth2Credential *) existingAccount).clientID;
298+
if (([providerName isEqualToString:@"google"] && existingAccount && clientID != nil)
299+
|| (![providerName isEqualToString:@"google"] && existingAccount != nil)) {
298300
if ([existingAccount isAuthorized]) {
299301
NSDictionary *accountResponse = [manager getAccountResponse:existingAccount cfg:cfg];
300302
callback(@[[NSNull null], @{

0 commit comments

Comments
 (0)