@hipsquare/use-access-code-identifier
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@hipsquare/use-access-code-identifier

A hook that identifies a query parameter called strapiOidcToken in browser and Capacitor environments. It seamlessly handles detecting if the user is in a browser or a Capcaitor. For browser apps, it uses the current URL's query parameters. For Capacitor apps, it tries to find launch parameters and parse it from there.

Once the token is identified is is stored in local storage.

Installation

yarn add @hipsquare/use-access-code-identifier

Usage

import { usestrapiOidcTokenIdentifier } from "@hipsquare/use-access-code-identifier";
const { strapiOidcToken, logout } = usestrapiOidcTokenIdentifier();

useEffect(
  () => console.log("Access token identified: ", strapiOidcToken),
  [strapiOidcToken]
);

Readme

Keywords

none

Package Sidebar

Install

npm i @hipsquare/use-access-code-identifier

Weekly Downloads

0

Version

0.1.2

License

none

Unpacked Size

7.84 kB

Total Files

7

Last publish

Collaborators

  • fchristl