@rss/auth-react

0.0.5 • Public • Published

@rss/auth-react

Helper library for working with token server on react

Installation

$ yarn add @rss/auth-react

Client Usage (react)

Initialize

Client.checkIfAuthenticated should be call in the app.component

import React from "react";

const Wrapper = () => {
  Client.checkIfAuthenticated("URL_TO_AUTHENTICATE_USER");
  return <App />;
};

Client API

Client.checkIfAuthenticated('URL_TO_AUTHENTICATE_USER')

check if user is authenticate. if not, redirect user to authentication url

Client.getUserToken()

get user token if available

Client.redirectToAuthentication('URL_TO_AUTHENTICATE_USER')

redirect user to token server for authentication

Readme

Keywords

none

Package Sidebar

Install

npm i @rss/auth-react

Weekly Downloads

0

Version

0.0.5

License

none

Unpacked Size

3.33 kB

Total Files

4

Last publish

Collaborators

  • rss