diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:58:47 +0200 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-08-31 17:58:47 +0200 |
commit | 3f66c101789f9a6d065490d3e3265c764698113f (patch) | |
tree | 97b1ef821e2dd8124e5d38a822c08efe21e7eaa2 /api/src/middlewares | |
parent | :sparkles: channel recipients (diff) | |
download | server-3f66c101789f9a6d065490d3e3265c764698113f.tar.xz |
:bug: db query fixes
Diffstat (limited to 'api/src/middlewares')
-rw-r--r-- | api/src/middlewares/Authentication.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/api/src/middlewares/Authentication.ts b/api/src/middlewares/Authentication.ts index 34a66a6b..a300c786 100644 --- a/api/src/middlewares/Authentication.ts +++ b/api/src/middlewares/Authentication.ts @@ -18,9 +18,9 @@ export const API_PREFIX_TRAILING_SLASH = /^\/api(\/v\d+)?\//; declare global { namespace Express { interface Request { - user_id: any; + user_id: string; user_bot: boolean; - token: any; + token: string; } } } @@ -47,7 +47,7 @@ export async function Authentication(req: Request, res: Response, next: NextFunc req.user_id = decoded.id; req.user_bot = user.bot; return next(); - } catch (error) { - return next(new HTTPError(error.toString(), 400)); + } catch (error: any) { + return next(new HTTPError(error?.toString(), 400)); } } |