Groups table renamed from groups to ldapgroups

This commit is contained in:
furo 2024-11-08 22:51:57 +01:00
parent 567aa5c12d
commit b234344036
2 changed files with 4 additions and 4 deletions

View File

@ -55,9 +55,9 @@ CREATE TABLE users (
yubikey TEXT DEFAULT '',
custattr TEXT DEFAULT '{}');
INSERT INTO groups(name, gidnumber) VALUES('users', 0);
INSERT INTO groups(name, gidnumber) VALUES('admins', 10);
INSERT INTO groups(name, gidnumber) VALUES('root', 100);
INSERT INTO ldapgroups(name, gidnumber) VALUES('users', 0);
INSERT INTO ldapgroups(name, gidnumber) VALUES('admins', 10);
INSERT INTO ldapgroups(name, gidnumber) VALUES('root', 100);
INSERT INTO includegroups(parentgroupid, includegroupid) VALUES(10, 0);
```

View File

@ -83,7 +83,7 @@ AUTH.post('/login', async (req, res) => {
const bearer = {
name: user.name,
id: user.uidnumber,
group: (await glauth.query("SELECT name FROM groups WHERE gidnumber = $1::int", [ user.primarygroup ])).rows[0].name
group: (await glauth.query("SELECT name FROM ldapgroups WHERE gidnumber = $1::int", [ user.primarygroup ])).rows[0].name
}
const token = jwt.sign(