change: Api Security and Rate Limiting

This commit is contained in:
Julian Krauser 2025-02-07 17:27:45 +01:00
parent 311a34f4b9
commit 8b08dda934
9 changed files with 173 additions and 19 deletions

View file

@ -1,11 +1,11 @@
import { Request, Response } from "express";
import { NextFunction, Request, Response } from "express";
import jwt from "jsonwebtoken";
import BadRequestException from "../exceptions/badRequestException";
import UnauthorizedRequestException from "../exceptions/unauthorizedRequestException";
import InternalException from "../exceptions/internalException";
import { JWTHelper } from "../helpers/jwtHelper";
export default async function authenticate(req: Request, res: Response, next: Function) {
export default async function authenticate(req: Request, res: Response, next: NextFunction) {
const bearer = req.headers.authorization?.split(" ")?.[1] ?? undefined;
if (!bearer) {