fix sharex
This commit is contained in:
parent
5290f4e960
commit
52b1aeea98
12 changed files with 80 additions and 49 deletions
|
@ -1,7 +1,7 @@
|
|||
import type {RequestHandler as Middleware, Router, Request, Response, NextFunction} from 'express';
|
||||
import express from "express";
|
||||
|
||||
import {db, createUser} from "../db";
|
||||
import {db, createUser} from "../types/db";
|
||||
|
||||
const router: Router = express.Router();
|
||||
|
||||
|
@ -9,7 +9,6 @@ const adminCheck: Middleware = (req: Request, res: Response, next: NextFunction)
|
|||
if (!req.user)
|
||||
return res.status(403).send("You are not authorized to perform this action");
|
||||
else {
|
||||
//@ts-ignore
|
||||
if (req.user.username != "admin")
|
||||
return res.status(403).send("You are not authorized to perform this action");
|
||||
next();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue