1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 20:39:28 +00:00

Fix multiple instantiation problem

This commit is contained in:
2022-03-30 10:08:46 +00:00
parent a97c2e3dc5
commit b489f055aa
4 changed files with 14 additions and 12 deletions

View File

@@ -70,11 +70,12 @@ router.all(/user\/(.{36})(\/.*)?/, async (req, res, next) => {
)))
return res.redirect('/admin/dashboard');
req.user = u;
next();
});
router.get('/user/:id', async (req, res) => {
const u = await new User(req.db, null, req.params.id);
router.get('/user/:id', (req, res) => {
const u = req.user;
return res.render('user', {
title: `Stratos - ${u.shortName}`,