Skip to content

Conversation

@pedro-rosario
Copy link
Contributor

@pedro-rosario pedro-rosario commented May 1, 2019

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

clay/amphora-auth#19

TODO

Closes #640

@pedro-rosario pedro-rosario changed the title Allow plugins to opt-in/out of authentication Allow plugins to opt-in for authentication May 1, 2019
@pedro-rosario pedro-rosario added the 8.x Breaking changes for the next major version of Amphora label May 1, 2019
Copy link
Contributor

@manuelurenah manuelurenah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏄

@pedro-rosario
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.x Breaking changes for the next major version of Amphora blocked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Amphora Plugins Auth Requirement

3 participants