Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit e40590d

Browse files
Merge pull request #1265 from NathanWalker/feature/google-web-token-include
feat(google): include web friendly oauth2 token
2 parents b6a5636 + 1968fa0 commit e40590d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/firebase.ios.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ function toLoginResult(user, additionalUserInfo?: FIRAdditionalUserInfo): User {
680680
if (pid === 'facebook.com' && typeof (FBSDKAccessToken) !== "undefined") { // FIRFacebookAuthProviderID
681681
const fbCurrentAccessToken = FBSDKAccessToken.currentAccessToken();
682682
providers.push({id: pid, token: fbCurrentAccessToken ? fbCurrentAccessToken.tokenString : null});
683+
} else if (pid === 'google.com' && typeof (GIDSignIn) !== "undefined" && GIDSignIn.sharedInstance() && GIDSignIn.sharedInstance().currentUser) {
684+
// include web compatible oauth2 token
685+
const gidCurrentAccessToken = GIDSignIn.sharedInstance().currentUser.authentication.accessToken;
686+
providers.push({id: pid, token: gidCurrentAccessToken });
683687
} else {
684688
providers.push({id: pid});
685689
}

0 commit comments

Comments
 (0)