change: Api Security and Rate Limiting
This commit is contained in:
parent
311a34f4b9
commit
8b08dda934
9 changed files with 173 additions and 19 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue