1.0.4 • Published 7 years ago
yatedo-auth-jwt v1.0.4
yatedo-auth-jwt
Module for Yatedo Apps authorization using JWT with Yatedo classical login form
Install
$ npm install --save yatedo-auth-jwt
Usage
To enable authentification process
// Import authentification process handler in app.js
import { ytdAuthRequired } from 'yatedo-auth-jwt';
// Set up the router that enable auth required onEnter
const rootRoute = {
onEnter: ytdAuthRequired(URL_AUTH_AUTHORIZE_PROD, URL_AUTH_AUTHORIZE_DEV),
component: App,
childRoutes: createRoutes(store),
};
To retrieve user information from JWT
// Import getUserinfosFromAuthJWT function
import { getUserinfosFromAuthJWT } from 'yatedo-auth-jwt';
// Retrieve user information
const userInfos = { getUserinfosFromAuthJWT() };
License
YATEDO ©