generated from lucien/api-template
add: added cats, admin rights and owner_username display
This commit is contained in:
parent
7dea3612af
commit
0e2139f408
9 changed files with 15 additions and 5 deletions
|
@ -44,7 +44,7 @@ router.post('/me', async (req, res) => {
|
|||
const users = await getUser(connection, decoded.id);
|
||||
connection.end();
|
||||
if (users[0]) {
|
||||
res.send({ id: users[0].id, username: users[0].username });
|
||||
res.send({ id: users[0].id, username: users[0].username, admin: users[0].admin });
|
||||
} else {
|
||||
res.status(401).send({ error: 'Invalid token' });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue