Added authGuard function and its implementations

Also refactored small code mistakes.
This commit is contained in:
Alexis
2021-01-19 18:52:52 +01:00
parent 410a58fc09
commit e8ca2416b7
31 changed files with 4062 additions and 3947 deletions

View File

@@ -163,19 +163,24 @@ INSERT INTO `permission` (slug) VALUES
("MODIFY_SPELLS"),
("DELETE_SPELLS"),
("WARN_USERS"),
("BAN_USERS");
("BAN_USERS"),
("SECRET_SPELLS"),
("SECRET_USERS");
INSERT INTO `role_permission` (role_id, permission_id) VALUES
(2, 1),
(3, 1),
(3, 2),
(3, 3),
(3, 7),
(4, 1),
(4, 2),
(4, 3),
(4, 4),
(4, 5),
(4, 6);
(4, 6),
(4, 7),
(4, 8);
-- USERS
INSERT INTO `user` (uuid, name, mail, avatar, gender, register_date, password, role_id, verified, banned) VALUES

View File

@@ -5,11 +5,11 @@ const fs = require('fs');
const knex = require('knex')({
client: "mysql",
connection: {
host : process.env.DB_HOST,
user : process.env.DB_USER,
password : process.env.DB_PASSWORD,
database : process.env.DB_DATABASE,
charset : "utf8"
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_DATABASE,
charset: "utf8"
},
});
const bookshelf = require('bookshelf')(knex);