From db9eed6288f34483a02cf289d930eded7d944b7d Mon Sep 17 00:00:00 2001 From: Nazar Gargol Date: Thu, 1 Aug 2019 13:06:15 +0200 Subject: [PATCH] Switched to use v2 http module instead of ovelooked v1 - Small adjustments in controller that came along with the switch --- core/server/api/v2/authentication.js | 4 ++++ core/server/web/api/v2/admin/routes.js | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/core/server/api/v2/authentication.js b/core/server/api/v2/authentication.js index 242b70cff3..ebd5918bc4 100644 --- a/core/server/api/v2/authentication.js +++ b/core/server/api/v2/authentication.js @@ -10,6 +10,7 @@ module.exports = { docName: 'authentication', setup: { + statusCode: 201, permissions: false, validation: { docName: 'setup' @@ -163,6 +164,9 @@ module.exports = { }, isInvitation: { + data: [ + 'email' + ], validation: { docName: 'invitations' }, diff --git a/core/server/web/api/v2/admin/routes.js b/core/server/web/api/v2/admin/routes.js index ba5ac88cac..1be698c6fa 100644 --- a/core/server/web/api/v2/admin/routes.js +++ b/core/server/web/api/v2/admin/routes.js @@ -184,14 +184,14 @@ module.exports = function apiRoutes() { router.post('/authentication/passwordreset', shared.middlewares.brute.globalReset, shared.middlewares.brute.userReset, - api.http(apiv2.authentication.generateResetToken) + http(apiv2.authentication.generateResetToken) ); - router.put('/authentication/passwordreset', shared.middlewares.brute.globalBlock, api.http(apiv2.authentication.resetPassword)); - router.post('/authentication/invitation', api.http(apiv2.authentication.acceptInvitation)); - router.get('/authentication/invitation', api.http(apiv2.authentication.isInvitation)); - router.post('/authentication/setup', api.http(apiv2.authentication.setup)); - router.put('/authentication/setup', mw.authAdminApi, api.http(apiv2.authentication.updateSetup)); - router.get('/authentication/setup', api.http(apiv2.authentication.isSetup)); + router.put('/authentication/passwordreset', shared.middlewares.brute.globalBlock, http(apiv2.authentication.resetPassword)); + router.post('/authentication/invitation', http(apiv2.authentication.acceptInvitation)); + router.get('/authentication/invitation', http(apiv2.authentication.isInvitation)); + router.post('/authentication/setup', http(apiv2.authentication.setup)); + router.put('/authentication/setup', mw.authAdminApi, http(apiv2.authentication.updateSetup)); + router.get('/authentication/setup', http(apiv2.authentication.isSetup)); // ## Images router.post('/images/upload',