amphora
amphora copied to clipboard
Allow plugins to opt-in for authentication
Feature Info
Description
- Passes a function (
useAuth) to each plugin.
Plugin example
'use strict';
const express = require('express');
module.exports = (router, _pluginDBAdapter, _publish, _sites, _site, useAuth) => {
const pluginRouter = express.Router();
useAuth(pluginRouter);
pluginRouter.use((req, res) => res.json({ method: req.method }));
router.use('/_test', pluginRouter);
}
Related
https://github.com/clay/amphora-auth/pull/19
TODO
- [ ] Update documentation
- [ ] Wait for the amphora-auth PR to get merged
Closes #640