Updated admin and mod flag system

This commit is contained in:
2021-03-24 08:22:47 +11:00
parent f60833ec17
commit e597974581
12 changed files with 134 additions and 47 deletions
+4 -2
View File
@@ -2,11 +2,13 @@ const jwt = require('jsonwebtoken');
const { tokens } = require('../database/models');
//generates a JWT token based on the given arguments
module.exports = (id, username, privilege) => {
module.exports = (id, username, type, admin, mod) => {
const content = {
id,
username,
privilege
type,
admin,
mod,
};
const accessToken = jwt.sign(content, process.env.SECRET_ACCESS, { expiresIn: '10m' });