From 179bed8924772af261d02631db8485a7e6965b92 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Sun, 29 Jul 2018 11:00:14 -0400 Subject: [PATCH] Fix login body verification --- app/routes/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/routes/auth.js b/app/routes/auth.js index 923bd0d..02375ec 100644 --- a/app/routes/auth.js +++ b/app/routes/auth.js @@ -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);