Skip to content

Latest commit

 

History

History
58 lines (36 loc) · 1.26 KB

account.md

File metadata and controls

58 lines (36 loc) · 1.26 KB
title
Account Helpers

Account Helpers

This contains helpers for google.accounts namespace.

idRevoke()

  • Type
function idRevoke(hint: string, callback?: RevocationCallback): void;
  • Details

This idRevoke provides a helper to access google.accounts.id.revoke method. It revokes the OAuth grant used to share the ID token for the specified user.

  • Example
import { idRevoke } from "vue3-google-signin"

idRevoke('1618033988749895', done => {
  console.log(done.error);
})

decodeCredential()

  • Type
function decodeCredential(credential: string): DecodedGoogleUser;
  • Details

Helper method to decode the JWT token retrieved from the GoogleSignIn onSuccess response into a usable Object

Google returns a jwt token encoded using base64url. This method will help you get a typed object to manipulate the data for your application.

:::info This is not an official method exposed by google :::

  • Example

<<< @/helpers/snippets/decodeCredential.vue

Output:

<<< @/helpers/snippets/decodeCredentialResponse.json