浏览代码

fix: unauthorized admin should receive 403 code

NGPixel 4 年之前
父节点
当前提交
4cd6fe8a56
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      server/controllers/common.js

+ 1 - 1
server/controllers/common.js

@@ -47,7 +47,7 @@ router.get(['/a', '/a/*'], (req, res, next) => {
     'manage:api'
   ])) {
     _.set(res.locals, 'pageMeta.title', 'Unauthorized')
-    return res.render('unauthorized', { action: 'view' })
+    return res.status(403).render('unauthorized', { action: 'view' })
   }
 
   _.set(res.locals, 'pageMeta.title', 'Admin')