CapacitorGoogleAuth icon indicating copy to clipboard operation
CapacitorGoogleAuth copied to clipboard

signIn method returns serverAuthCode attribute with value undefined

Open TadasMil opened this issue 3 years ago • 4 comments

I have a vue 3 component that should sign in user:

import { defineComponent, onMounted } from 'vue';
import { GoogleAuth } from '@codetrix-studio/capacitor-google-auth';

export default defineComponent({
  setup() {
    onMounted(() => {
      GoogleAuth.initialize();
    });

    const logIn = async () => {
      const response = await GoogleAuth.signIn();
      console.log(response);
    };

    return {
      logIn,
    };
  },
});

The response that I get is as follows:

{
  "email":"email",      
  "familyName":"name",
  "givenName":"name",
  "id":"id",
  "imageUrl":"img",
  "name":"name",
  "authentication":{"accessToken":"token","refreshToken":""},
  "serverAuthCode": undefined,
}

Dependencies

  @capacitor/cli: 4.1.0
  @capacitor/core: 4.1.0
  @capacitor/ios: 4.1.0
  @capacitor/android: 4.1.0

I'm curious why serverAuthCode attribute comes back as undefined?

TadasMil avatar Aug 28 '22 15:08 TadasMil

Have you tried setting grantOfflineAccess to true?

mirko77 avatar Sep 07 '22 08:09 mirko77

i have the same issue in the web token is failed { "type": "tokenFailed", "idpId": "google", "error": "server_error" }

khaledelbahay avatar Sep 07 '22 21:09 khaledelbahay

@mirko77

Have you tried setting grantOfflineAccess to true?

Yes, I've tried both, using true and false.

TadasMil avatar Sep 16 '22 20:09 TadasMil

Same thing. The serverAuthCode is undefined