diff --git a/packages/auth/bin/server.ts b/packages/auth/bin/server.ts index 58c62dbbd..be4d66933 100644 --- a/packages/auth/bin/server.ts +++ b/packages/auth/bin/server.ts @@ -58,8 +58,14 @@ void container.load().then((container) => { const logger: winston.Logger = container.get(TYPES.Auth_Logger) server.setErrorConfig((app) => { - app.use((error: Record, _request: Request, response: Response, _next: NextFunction) => { - logger.error(error.stack) + app.use((error: Record, request: Request, response: Response, _next: NextFunction) => { + logger.error(`${error.stack}`, { + method: request.method, + url: request.url, + snjs: request.headers['x-snjs-version'], + application: request.headers['x-application-version'], + userId: response.locals.user ? response.locals.user.uuid : undefined, + }) response.status(500).send({ error: { diff --git a/packages/auth/src/Infra/InversifyExpressUtils/Middleware/LockMiddleware.ts b/packages/auth/src/Infra/InversifyExpressUtils/Middleware/LockMiddleware.ts index cba8e1eb6..6bf265749 100644 --- a/packages/auth/src/Infra/InversifyExpressUtils/Middleware/LockMiddleware.ts +++ b/packages/auth/src/Infra/InversifyExpressUtils/Middleware/LockMiddleware.ts @@ -26,6 +26,8 @@ export class LockMiddleware extends BaseMiddleware { message: usernameOrError.getError(), }, }) + + return } const username = usernameOrError.getValue()