Skip to content

Commit

Permalink
Merge pull request #83 from lzdyes/main
Browse files Browse the repository at this point in the history
fix: Google One Tap callback response error
  • Loading branch information
kasvith authored Aug 1, 2024
2 parents 17c5dcc + 926ebdc commit 97b9f12
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/GoogleSignInButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ watchEffect(() => {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
client_id: clientId!,
callback: (credentialResponse: CredentialResponse) => {
if (!credentialResponse.clientId || !credentialResponse.credential) {
if (!credentialResponse.credential) {
emits("error");
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/composables/useOneTap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function useOneTap(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
client_id: clientId!,
callback: (credentialResponse: CredentialResponse) => {
if (!credentialResponse.clientId || !credentialResponse.credential) {
if (!credentialResponse.credential) {
onError?.();
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ export interface CredentialResponse {
select_by?: SelectBy;

/**
* Client ID returned from google
* This field is only defined when user clicks a Sign in with Google button to sign in, and the button's state attribute is specified.
*
* @type {string}
* @memberof CredentialResponse
*/
clientId?: string;
state?: string;
}

/**
Expand Down

0 comments on commit 97b9f12

Please sign in to comment.