abacritt / angularx-social-login

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

getAccessToken causes [GSI_LOGGER-TOKEN_CLIENT]: Set token failed. Gapi.client.setToken undefined. #538

Closed mahmuzicamel closed 1 year ago

mahmuzicamel commented 2 years ago

Version: 1.2.1 Provider: Google

Hello, after calling the methodgetAccessToken(PROVIDER_ID), GSI throws a warning - [GSI_LOGGER-TOKEN_CLIENT]: Set token failed. Gapi.client.setToken undefined. Here is my code snippet:

app.module.ts providers: [ { provide: 'SocialAuthServiceConfig', useValue: { autoLogin: true, providers: [ { id: GoogleLoginProvider.PROVIDER_ID, provider: new GoogleLoginProvider(environment.googleOAuthClientID, googleLoginOptions) }, ], } as SocialAuthServiceConfig, },

auth-service.ts public registerAuthService() { this.socialAuthService.authState.subscribe(user => { this.socialAuthService.getAccessToken(GoogleLoginProvider.PROVIDER_ID).then(token => { if (token) { user.authToken = token; this.socialUser.next(user); } }); }); }

Any idea what is going on?

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.