Added id to the auth token

Resolved #1
This commit is contained in:
2021-03-07 06:41:01 +11:00
parent 2e024f71c3
commit aacd64a769
8 changed files with 14 additions and 13 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ module.exports = (token, callback) => {
const tokenRecord = tokens.findOne({
where: {
token
token: token || ''
}
});
@@ -24,7 +24,7 @@ module.exports = (token, callback) => {
return callback(403);
}
const result = generate(user.username, user.privilege);
const result = generate(user.id, user.username, user.privilege);
destroy(token);