Express Auth In A Box
Introduction
Don't ever use this in production. It is strictly for dictactic/research purposes.
Just:
- init an express app
npm i express_auth_box
const { handler } = require('express_auth_box')
- and mount the handler as middleware:
app.use(handler
Out of the box(!) you get /auth/login/
, /auth/register/
, and /auth/verify/
routes!
Yay!
Example
Here is an example server app with both public and private routes:
const express = ;const bodyParser = ;const cors = ;const logger = ;const app = ; const handler restrict = ; app;app;app; const router = express;router;router;router; app; moduleexports = app;