From ded061757044ef9d4ca088ec95432bdf5b06f358 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Fri, 22 Feb 2019 02:08:24 +0000 Subject: [users] Move user based calls from the authentication to the users api --- server/api/users.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/api/users.js') diff --git a/server/api/users.js b/server/api/users.js index aca4188..853740c 100644 --- a/server/api/users.js +++ b/server/api/users.js @@ -5,6 +5,7 @@ var jwt = require('jsonwebtoken') var express = require('express') const { decorateApp } = require('@awaitjs/express') var router = decorateApp(express.Router()) +var authentication = require(path.join(__appdir, 'lib', 'authentication')) // ############################################################################ // ########################### GET requests ################################# @@ -48,6 +49,16 @@ router.postAsync('/:id/roles', async (req, res) => { } }) +// Post request for creating new user accounts. +router.post('/', (req, res) => { + authentication.signup(req, res) +}) + +// Post request for changing the password. +router.post('/:id/password', (req, res) => { + authentication.changepassword(req, res) +}) + // ############################################################################ // ############################################################################ -- cgit v1.2.3-55-g7522