Compare commits
2 Commits
993096741d
...
5c259484ee
Author | SHA1 | Date | |
---|---|---|---|
5c259484ee | |||
740d7f10f5 |
@ -4,14 +4,6 @@ import { getConnectionManager } from 'typeorm';
|
||||
import { IllegalJWTError, NoPermissionError, UserNonexistantOrRefreshtokenInvalidError } from './errors/AuthError';
|
||||
import { User } from './models/entities/User';
|
||||
// -----------
|
||||
const sampletoken = jwt.sign({
|
||||
"permissions": {
|
||||
"TRACKS": ["read", "update", "delete", "add"]
|
||||
// "TRACKS": []
|
||||
}
|
||||
}, "securekey")
|
||||
console.log(`sampletoken: ${sampletoken}`);
|
||||
// -----------
|
||||
const authchecker = async (action: Action, permissions: string | string[]) => {
|
||||
let required_permissions = undefined
|
||||
if (typeof permissions === "string") {
|
||||
|
@ -1,10 +0,0 @@
|
||||
import { Router } from "express";
|
||||
import jwtauth from "../../middlewares/jwtauth";
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.use("*", jwtauth, async (req, res, next) => {
|
||||
return res.send("ok");
|
||||
});
|
||||
|
||||
export default router;
|
Loading…
x
Reference in New Issue
Block a user