fix some typos

This commit is contained in:
Girish Ramakrishnan
2020-12-20 14:41:16 -08:00
parent 56707ac86a
commit e5209a1392
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -124,9 +124,9 @@ function passwordAuth(req, res, next) {
if (typeof req.body.username !== 'string') return next(new HttpError(400, 'username must be non empty string' ));
if (typeof req.body.password !== 'string') return next(new HttpError(400, 'password must be non empty string' ));
if ('totpToken' in req.body && typeof req.body.password !== 'string') return next(new HttpError(400, 'totpToken must be a string' ));
if ('totpToken' in req.body && typeof req.body.totpToken !== 'string') return next(new HttpError(400, 'totpToken must be a string' ));
const { username, password, totpToken } = req.body.username;
const { username, password, totpToken } = req.body;
const api = username.indexOf('@') !== -1 ? users.verifyWithEmail : users.verifyWithUsername;