Browse Source

feat: Redirect admin to students list

pull/7619/head
Ruslan Semak 2 months ago
parent
commit
c2125da238
1 changed files with 6 additions and 1 deletions
  1. 7
      server/controllers/common.js

7
server/controllers/common.js

@ -429,7 +429,12 @@ router.get('/*', async (req, res, next) => {
try {
// -> Get Page from cache
if (pageArgs.path === 'Users/profile') { // Ruslan: Open User's page on "Users/profile" request
if (pageArgs.path === 'Users/profile') { // Ruslan: Open User's page on "Users/profile" request for student, but "Users" for admin
if (req.user.id === 1) { // Administrator
res.redirect(`/Users`)
return
}
for (const groupId of req.user.groups) {
const group = await WIKI.models.groups.query().findById(groupId)

Loading…
Cancel
Save