summaryrefslogtreecommitdiffstats
path: root/server/api/users.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-22 03:08:24 +0100
committerJannik Schönartz2019-02-22 03:08:24 +0100
commitded061757044ef9d4ca088ec95432bdf5b06f358 (patch)
treee4b79e51448dd94be3acb3884ebe14a25bf38db6 /server/api/users.js
parent[authentication] Implement initial root account setup (diff)
downloadbas-ded061757044ef9d4ca088ec95432bdf5b06f358.tar.gz
bas-ded061757044ef9d4ca088ec95432bdf5b06f358.tar.xz
bas-ded061757044ef9d4ca088ec95432bdf5b06f358.zip
[users] Move user based calls from the authentication to the users api
Diffstat (limited to 'server/api/users.js')
-rw-r--r--server/api/users.js11
1 files changed, 11 insertions, 0 deletions
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)
+})
+
// ############################################################################
// ############################################################################