1
0
mirror of https://github.com/Foltik/Shimapan synced 2025-01-05 15:58:03 -05:00

Fix login body verification

This commit is contained in:
Jack Foltz 2018-07-29 11:00:14 -04:00
parent 456cac6b17
commit 179bed8924
Signed by: foltik
GPG Key ID: 303F88F996E95541

View File

@ -86,7 +86,10 @@ router.post('/register',
res.status(200).json({'message': 'Registration successful.'});
}));
const loginProps = [{name: 'username', type: 'string'}, {name: 'password', type: 'string'}];
const loginProps = [
{name: 'username', type: 'string', optional: true},
{name: 'displayname', type: 'string', optional: true},
{name: 'password', type: 'string'}];
router.post('/login', verifyBody(loginProps), canonicalizeRequest, wrap(async (req, res, next) => {
// Authenticate
const user = await authenticate(req, res, next);