From 1ae33eebed98fa17b727b2d0c627e4689e1575be Mon Sep 17 00:00:00 2001 From: Alexandru Lazar Date: Mon, 20 Mar 2017 10:59:08 +0200 Subject: [PATCH] [fix]: for Google authentication make sure the clientID is present when performing authorization --- ios/OAuthManager/OAuthManager.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/OAuthManager/OAuthManager.m b/ios/OAuthManager/OAuthManager.m index fdcdde8..b280343 100644 --- a/ios/OAuthManager/OAuthManager.m +++ b/ios/OAuthManager/OAuthManager.m @@ -294,7 +294,9 @@ - (NSDictionary *) getConfigForProvider:(NSString *)name NSMutableDictionary *cfg = [[manager getConfigForProvider:providerName] mutableCopy]; DCTAuthAccount *existingAccount = [manager accountForProvider:providerName]; - if (existingAccount != nil) { + NSString *clientID = ((DCTOAuth2Credential *) existingAccount).clientID; + if (([providerName isEqualToString:@"google"] && existingAccount && clientID != nil) + || (![providerName isEqualToString:@"google"] && existingAccount != nil)) { if ([existingAccount isAuthorized]) { NSDictionary *accountResponse = [manager getAccountResponse:existingAccount cfg:cfg]; callback(@[[NSNull null], @{