Switched to use v2 http module instead of ovelooked v1

- Small adjustments in controller that came along with the switch
This commit is contained in:
Nazar Gargol 2019-08-01 13:06:15 +02:00
parent 956da204f2
commit db9eed6288
2 changed files with 11 additions and 7 deletions

View File

@ -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'
},

View File

@ -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',