0.3.10 • Published 2 years ago
pg-authentication v0.3.10
Introduction
This package will help you validate user credentials by decoding jwt user token and refresh token in cookies then redirect user to appropriate url
Commands
To install pg-authentication, use:
npm i pg-authentication # or yarn add pg-authentication
How to use
After installing pg-authentication, just import authentication from the package
import authentication from 'pg-authentication';
then pass it as the parameter in app.use
app.use(authentication());
If the token is validated you will be redirected to the url specified, otherwise you will be redirected to sign in page.