CapacitorGoogleAuth
CapacitorGoogleAuth copied to clipboard
signIn method returns serverAuthCode attribute with value undefined
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?
Have you tried setting grantOfflineAccess to true?
i have the same issue in the web token is failed { "type": "tokenFailed", "idpId": "google", "error": "server_error" }
@mirko77
Have you tried setting
grantOfflineAccesstotrue?
Yes, I've tried both, using true and false.
Same thing. The serverAuthCode is undefined