1.0.4 • Published 2 years ago

expressjs-session-check v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ExpressJS-Session-Check

This is a simple tool to check if your session variable is not null and redirect to the specified location.

Installation

npm i expressjs-session-check

Usage

Specify the location of your views directory

const checkSignIn = require('expressjs-session-check');

How to use it in your code:

const checkSignIn = require('expressjs-session-check');

router.get('/SessionTest', function(req, res, next) {
  user = req.session.user;
  checkSignIn(user, "/RedirectRoute", res);
  res.render('Session/index',{title:"Session Test"})
});

License

MIT