From 1e1ba96a3c81377d709af4c79d505ce2ed7df939 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Thu, 12 Jan 2023 13:46:36 +0100 Subject: Dev/post refactor fixes (#927) * Re-introduce outgoing message logging Signed-off-by: TheArcaneBrony * Websocket dumping * Sentry user count on API * Generate session ID upon opening websocket, fix gateway dumps * Async file io in src/gateway/events/Message.ts Signed-off-by: TheArcaneBrony * Async file io in src/util/util/Config.ts Signed-off-by: TheArcaneBrony * Make pre-commit hook executable Signed-off-by: TheArcaneBrony * Fixed sync file io in src/util/util/Config.ts Signed-off-by: TheArcaneBrony * Fixed missing await call in src/util/util/AutoUpdate.ts Signed-off-by: TheArcaneBrony * Add comment to src/gateway/events/Connection.ts Signed-off-by: TheArcaneBrony * Clean up gateway dumping code Signed-off-by: TheArcaneBrony Co-authored-by: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> --- src/api/middlewares/Authentication.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/api/middlewares/Authentication.ts') diff --git a/src/api/middlewares/Authentication.ts b/src/api/middlewares/Authentication.ts index ec2c42e5..2aa42e8b 100644 --- a/src/api/middlewares/Authentication.ts +++ b/src/api/middlewares/Authentication.ts @@ -1,6 +1,7 @@ import { NextFunction, Request, Response } from "express"; import { HTTPError } from "lambert-server"; import { checkToken, Config, Rights } from "@fosscord/util"; +import * as Sentry from "@sentry/node"; export const NO_AUTHORIZATION_ROUTES = [ // Authentication routes @@ -63,6 +64,8 @@ export async function Authentication( if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401)); + Sentry.setUser({ id: req.user_id }); + try { const { jwtSecret } = Config.get().security; -- cgit 1.5.1