Skip to content
Snippets Groups Projects
Commit 9261c0a2 authored by Sebastian's avatar Sebastian
Browse files

feat(component-invite): fix authsome post collections

parent e0746e16
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
const config = require('config')
const Authsome = require('authsome')
const mode = require(config.get('authsome.mode'))
const authsome = new Authsome({ ...config.authsome, mode }, {})
module.exports = authsome
...@@ -40,6 +40,7 @@ module.exports = models => async (req, res) => { ...@@ -40,6 +40,7 @@ module.exports = models => async (req, res) => {
error: notFoundError.message, error: notFoundError.message,
}) })
} }
const baseUrl = `${req.protocol}://${req.get('host')}` const baseUrl = `${req.protocol}://${req.get('host')}`
const params = { const params = {
baseUrl, baseUrl,
......
...@@ -97,11 +97,11 @@ function unauthenticatedUser(operation, object) { ...@@ -97,11 +97,11 @@ function unauthenticatedUser(operation, object) {
async function authenticatedUser(user, operation, object, context) { async function authenticatedUser(user, operation, object, context) {
// Allow the authenticated user to POST a collection (but not with a 'filtered' property) // Allow the authenticated user to POST a collection (but not with a 'filtered' property)
// if (operation === 'POST' && object.path === '/collections') { if (operation === 'POST' && object.path === '/collections') {
// return { return {
// filter: collection => omit(collection, 'filtered'), filter: collection => omit(collection, 'filtered'),
// } }
// } }
// Allow the authenticated user to GET collections they own // Allow the authenticated user to GET collections they own
if (operation === 'GET' && object === '/collections/') { if (operation === 'GET' && object === '/collections/') {
......
...@@ -21,9 +21,14 @@ const getDbConfig = () => { ...@@ -21,9 +21,14 @@ const getDbConfig = () => {
module.exports = { module.exports = {
authsome: { authsome: {
mode: path.resolve(__dirname, 'authsome.js'), mode: path.resolve(__dirname, 'authsome-mode.js'),
teams: { teams: {
// TODO handlingEditor: {
name: 'Handling Editors',
},
reviewer: {
name: 'Reviewer',
},
}, },
}, },
validations: path.resolve(__dirname, 'validations.js'), validations: path.resolve(__dirname, 'validations.js'),
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment