1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-02 01:19:31 +00:00

Reorder User constructor params

This commit is contained in:
2022-04-07 13:38:41 +00:00
parent 95b1636288
commit ad1a50d4f2
9 changed files with 16 additions and 17 deletions

View File

@@ -10,7 +10,7 @@ const User = require('../lib/User');
const Test = require('../lib/Test');
router.get('/tests', async (req, res) => {
const u = await new User(req.db, null, req.session.userId);
const u = await new User(req.db, req.session.userId);
return res.render('tests', {
title: 'Stratos - Tests',
@@ -128,7 +128,7 @@ router.all(/test\/(.{36})(\/.*)?/, async (req, res, next) => {
}
if (!await t.hasAccess(await new User(
req.db, null,
req.db,
req.session.userId
)))
return res.redirect('/admin/tests');