abacritt / angularx-social-login

Social login and authentication module for Angular 17
634 stars 387 forks source link

TypeError: Cannot read properties of undefined (reading 'signIn') #530

Closed volo28K closed 1 year ago

volo28K commented 2 years ago

Hi there!

Have a problem with Google sign in

Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'signIn') TypeError: Cannot read properties of undefined (reading 'signIn') at abacritt-angularx-social-login.mjs:93:30 at new ZoneAwarePromise (zone.js:1387:1) at GoogleLoginProvider.signIn (abacritt-angularx-social-login.mjs:90:16) at abacritt-angularx-social-login.mjs:275:26 at new ZoneAwarePromise (zone.js:1387:1) at SocialAuthService.signIn (abacritt-angularx-social-login.mjs:267:16) at SignInService.loginWithGoogle (sign-in.service.ts:52:35) at AuthCardModalComponent.loginWithGoogle (auth-card-modal.component.ts:44:31) at AuthCardModalComponent_ng_template_19_Template_app_outline_button_click_2_listener (auth-card-modal.component.html:139:70)

Heatmanofurioso commented 2 years ago

Hi @volo28K What version of the library are you using?

volo28K commented 2 years ago

Hi @Heatmanofurioso Currently, I am using 1.1.0, my Angular version is 13.*

Heatmanofurioso commented 2 years ago

@volo28K Can you please update to 1.2.1, and re-attempt? Some fixes were made between 1.1.0 and 1.2.1

volo28K commented 2 years ago

@Heatmanofurioso Made an update to version 1.2.1 and get another error right now. Error: node_modules/@abacritt/angularx-social-login/directives/google-signin-button.directive.d.ts:7:18 - error TS2314: Generic type 'ɵɵDirectiveDeclaration' requires 6 type argument(s). static ɵdir: i0.ɵɵDirectiveDeclaration<GoogleSigninButtonDirective, "asl-google-signin-button", never, {}, {}, never, never, false>;

volo28K commented 2 years ago

@Heatmanofurioso Do you have any updates here?

kjdeepak commented 2 years ago

@Heatmanofurioso I am facing the same issue. Anyone has any suggestion/fix to get around this?

kjdeepak commented 2 years ago

Hi there!

Have a problem with Google sign in

Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'signIn') TypeError: Cannot read properties of undefined (reading 'signIn') at abacritt-angularx-social-login.mjs:93:30 at new ZoneAwarePromise (zone.js:1387:1) at GoogleLoginProvider.signIn (abacritt-angularx-social-login.mjs:90:16) at abacritt-angularx-social-login.mjs:275:26 at new ZoneAwarePromise (zone.js:1387:1) at SocialAuthService.signIn (abacritt-angularx-social-login.mjs:267:16) at SignInService.loginWithGoogle (sign-in.service.ts:52:35) at AuthCardModalComponent.loginWithGoogle (auth-card-modal.component.ts:44:31) at AuthCardModalComponent_ng_template_19_Template_app_outline_button_click_2_listener (auth-card-modal.component.html:139:70)

@volo28K Check whether your domain is whitelisted! I faced a similar issue. So I whitelisted my domain and waited for 30 minutes to take effect.

Edit 1: However this issue can be observed again in incognito mode.

dtiwari095 commented 2 years ago

@Heatmanofurioso i am getting this error,

[GSI_LOGGER]: The given origin is not allowed for the given client ID.

need your help.

mehmetatacan commented 2 years ago

Yes I am giving same error. How can I fix this error. I'm using latest version of angularx-social-login. Facebook login is running correctly but google login has corrupted

ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'signIn') TypeError: Cannot read properties of undefined (reading 'signIn') at angularx-social-login.js:85:30 at new ZoneAwarePromise (zone.js:1427:29) at GoogleLoginProvider.signIn (angularx-social-login.js:82:16) at angularx-social-login.js:267:26 at new ZoneAwarePromise (zone.js:1427:29) at SocialAuthService.signIn (angularx-social-login.js:259:16) at AuthSignInComponent.signInWithGoogle (sign-in.component.ts:149:26) at AuthSignInComponent_Template_button_click_57_listener (sign-in.component.html:120:85) at executeListenerWithErrorHandling (core.mjs:15652:16) at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15687:22) at resolvePromise (zone.js:1211:31) at resolvePromise (zone.js:1165:17) at zone.js:1278:17 at _ZoneDelegate.invokeTask (zone.js:406:31) at Object.onInvokeTask (core.mjs:26490:33) at _ZoneDelegate.invokeTask (zone.js:405:60) at Zone.runTask (zone.js:178:47) at drainMicroTaskQueue (zone.js:585:35) at ZoneTask.invokeTask [as invoke] (zone.js:491:21) at invokeTask (zone.js:1648:18)

ddavid-son commented 1 year ago

@Heatmanofurioso i am getting this error,

[GSI_LOGGER]: The given origin is not allowed for the given client ID.

need your help.

try this:

*Last note, for local development, make sure you mention both http://localhost and http://localhost:4200 in google's cloud platform "Authorized Javascript Origins".

Heatmanofurioso commented 1 year ago

The origin contract is something that you need to validate in your Google API console.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.