File tree Expand file tree Collapse file tree
components/SignInButtons/GoogleSignIn Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,10 +97,16 @@ export default {
9797 WEB_CLIENT_ID : '921154746561-gpsoaqgqfuqrfsjdf8l7vohfkfj7b9up.apps.googleusercontent.com' ,
9898 // cspell:disable-next-line
9999 IOS_CLIENT_ID : '921154746561-s3uqn2oe4m85tufi6mqflbfbuajrm2i3.apps.googleusercontent.com' ,
100- // cspell:disable-next-line
101- HYBRID_APP_WEB_CLIENT_ID : '1008697809946-5e095eqem3o6ugtpc2rjf7v880tcp28p.apps.googleusercontent.com' ,
102- // cspell:disable-next-line
103- HYBRID_APP_IOS_CLIENT_ID : '1008697809946-sh04nqq0hea396s1qdqqbj6ia649odb2.apps.googleusercontent.com' ,
100+ HYBRID_APP : {
101+ // cspell:disable-next-line
102+ IOS_CLIENT_ID : '1008697809946-sh04nqq0hea396s1qdqqbj6ia649odb2.apps.googleusercontent.com' ,
103+ WEB_CLIENT_ID : {
104+ // cspell:disable-next-line
105+ IOS : '1008697809946-5e095eqem3o6ugtpc2rjf7v880tcp28p.apps.googleusercontent.com' ,
106+ // cspell:disable-next-line
107+ ANDROID : '240677659774-86pov3adub93cv4b8uj13g7varolmk2l.apps.googleusercontent.com' ,
108+ }
109+ } ,
104110 } ,
105111 GCP_GEOLOCATION_API_KEY : googleGeolocationAPIKey ,
106112 FIREBASE_WEB_CONFIG : {
Original file line number Diff line number Diff line change @@ -5,16 +5,30 @@ import Log from '@libs/Log';
55import { beginGoogleSignIn } from '@userActions/Session' ;
66import CONFIG from '@src/CONFIG' ;
77import CONST from '@src/CONST' ;
8+ import getPlatform from '@libs/getPlatform' ;
89import type { GoogleSignInProps } from '.' ;
910import type GoogleError from './types' ;
1011
12+ /**
13+ * Helper function returning webClientId based on a platform used
14+ */
15+ function getWebClientId ( ) {
16+ if ( ! CONFIG . IS_HYBRID_APP ) {
17+ return CONFIG . GOOGLE_SIGN_IN . WEB_CLIENT_ID ;
18+ }
19+
20+ return getPlatform ( ) === CONST . PLATFORM . ANDROID
21+ ? CONFIG . GOOGLE_SIGN_IN . HYBRID_APP . WEB_CLIENT_ID . ANDROID
22+ : CONFIG . GOOGLE_SIGN_IN . HYBRID_APP . WEB_CLIENT_ID . IOS ;
23+ }
24+
1125/**
1226 * Google Sign In method for iOS and android that returns identityToken.
1327 */
1428function googleSignInRequest ( ) {
1529 GoogleSignin . configure ( {
16- webClientId : CONFIG . IS_HYBRID_APP ? CONFIG . GOOGLE_SIGN_IN . HYBRID_APP_WEB_CLIENT_ID : CONFIG . GOOGLE_SIGN_IN . WEB_CLIENT_ID ,
17- iosClientId : CONFIG . IS_HYBRID_APP ? CONFIG . GOOGLE_SIGN_IN . HYBRID_APP_IOS_CLIENT_ID : CONFIG . GOOGLE_SIGN_IN . IOS_CLIENT_ID ,
30+ webClientId : getWebClientId ( ) ,
31+ iosClientId : CONFIG . IS_HYBRID_APP ? CONFIG . GOOGLE_SIGN_IN . HYBRID_APP . IOS_CLIENT_ID : CONFIG . GOOGLE_SIGN_IN . IOS_CLIENT_ID ,
1832 offlineAccess : false ,
1933 } ) ;
2034
You can’t perform that action at this time.
0 commit comments