@guardian/identity-auth-frontend
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

IdentityAuthFrontend

A wrapper around @guardian/identity-auth which manages creating and configuring a IdentityAuth singleton to be used solely on www.theguardian.com by DCR, Frontend, and Commercial.

Usage

import { getIdentityAuth } from '@guardian/identity-auth-frontend';

const identityAuth = getIdentityAuth();

// Check if the user is logged in and return the current auth state
const authState = await identityAuth.isSignedInWithAuthState();

authState.isAuthenticated; // true or false
authState?.accessToken; // the user's access token object
authState?.idToken; // the user's id token object

// or boolean only
const isLoggedIn = await identityAuth.isSignedIn();

Readme

Keywords

none

Package Sidebar

Install

npm i @guardian/identity-auth-frontend

Weekly Downloads

626

Version

4.0.1

License

Apache-2.0

Unpacked Size

20.1 kB

Total Files

6

Last publish

Collaborators

  • joecowton1
  • guardian-developers
  • akash1810
  • reetta
  • sndrs
  • mxdvl