mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:07:08 +00:00
Fix login endpoint (checkValidCredentials is now async)
This commit is contained in:
@@ -4,7 +4,7 @@ const jwt = require('../../../lib/jwt');
|
||||
async function login (req, res, next) {
|
||||
if (req.body) {
|
||||
const {user, password} = req.body;
|
||||
const payload = jwt.checkValidCredentials({user, password});
|
||||
const payload = await jwt.checkValidCredentials({user, password});
|
||||
if (payload) {
|
||||
jwt.issue(payload, req, res);
|
||||
res.status(204).send();
|
||||
|
||||
Reference in New Issue
Block a user