how can I migrate google.signIn()?

877 Views Asked by At

I'm using the library angularx-social-login in my angular app, but now there's an error in the console about 'deprecated' Then I try to use

return gapi.auth2
  .getAuthInstance()
  .signIn({
    scope:
      'https://www.googleapis.com/auth/cloud-platform https://www.googleapis.com/auth/cloud-platform.read-only',
  })
  .then(
    () => {
      console.log('Sign-in successful');
      this.loadClient();

    },
    (err: any) => {
      console.error('Error signing in', err);
    }
  );

But is the same error... so what's the new form to sign in with google in angular?

1

There are 1 best solutions below

0
On

Use Google API Javascript client

https://github.com/google/google-api-javascript-client

See also

https://developers.google.com/identity