0.0.5 • Published 6 years ago

@rss/auth-react v0.0.5

Weekly downloads
1
License
-
Repository
-
Last release
6 years ago

@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

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago