We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4959257 commit d5d44f4Copy full SHA for d5d44f4
1 file changed
assets/js/sign-in-with-google.ts
@@ -95,7 +95,11 @@ export async function handleCredentialResponse(
95
}
96
97
export function setupSignInWithGoogle( data: SignInWithGoogleData ) {
98
- google?.accounts.id.initialize( {
+ if ( typeof google?.accounts?.id === 'undefined' ) {
99
+ return;
100
+ }
101
+
102
+ google.accounts.id.initialize( {
103
client_id: data.clientID, // eslint-disable-line camelcase
104
callback: ( response ) => handleCredentialResponse( response, data ),
105
library_name: 'Site-Kit', // eslint-disable-line camelcase
@@ -145,7 +149,7 @@ export function setupSignInWithGoogle( data: SignInWithGoogleData ) {
145
149
146
150
147
151
if ( data.shouldShowOneTapPrompt ) {
148
- google?.accounts.id.prompt();
152
+ google.accounts.id.prompt();
153
154
155
if ( data.redirectTo ) {
0 commit comments