瀏覽代碼

Fix login body verification

production
Jack Foltz 5 年之前
父節點
當前提交
179bed8924
簽署人: foltik <jack@foltz.io> GPG 金鑰 ID: 303F88F996E95541
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      app/routes/auth.js

+ 4
- 1
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);


Loading…
取消
儲存