@cnscloud/auth-middlewaredeprecated

Authentication middleware that handles the Authentication header and progresses a request with the verified token decoded.

Usage no npm install needed!

<script type="module">
  import cnscloudAuthMiddleware from 'https://cdn.skypack.dev/@cnscloud/auth-middleware';
</script>

README

Example Usage

require('dotenv').config();
const config = require('config');
const express = require('express');
const authMiddleware = require('@cnscloud/auth-middleware');

const app = express();


app.get('/', authMiddleware, (req, res) => {
  res.send(req.user);
});

app.use((err, req, res, next) => {
  res.send(err.message);
});

app.listen(config.get('TEST_PORT'));