mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-10 13:37:01 +03:00
Remove casting
This commit is contained in:
@@ -3,14 +3,14 @@ import {getHash} from "../utils/getHash";
|
||||
import {Request, Response} from "express";
|
||||
import { config } from "../config";
|
||||
import { Category, Service, VideoID, VideoIDHash } from "../types/segments.model";
|
||||
import { HashedUserID, UserID } from "../types/user.model";
|
||||
import { UserID } from "../types/user.model";
|
||||
import { QueryCacher } from "../utils/queryCacher";
|
||||
import { isUserVIP } from "../utils/isUserVIP";
|
||||
|
||||
export async function shadowBanUser(req: Request, res: Response): Promise<Response> {
|
||||
const userID = req.query.userID as string;
|
||||
const userID = req.query.userID as UserID;
|
||||
const hashedIP = req.query.hashedIP as string;
|
||||
let adminUserIDInput = req.query.adminUserID as string;
|
||||
const adminUserIDInput = req.query.adminUserID as UserID;
|
||||
|
||||
const enabled = req.query.enabled === undefined
|
||||
? true
|
||||
@@ -28,9 +28,9 @@ export async function shadowBanUser(req: Request, res: Response): Promise<Respon
|
||||
}
|
||||
|
||||
//hash the userID
|
||||
adminUserIDInput = getHash(adminUserIDInput);
|
||||
const adminUserID = getHash(adminUserIDInput);
|
||||
|
||||
const isVIP = await isUserVIP(adminUserIDInput as HashedUserID);
|
||||
const isVIP = await isUserVIP(adminUserID);
|
||||
if (!isVIP) {
|
||||
//not authorized
|
||||
return res.sendStatus(403);
|
||||
|
||||
Reference in New Issue
Block a user