fix(auth): missing return statement in lock middleware
This commit is contained in:
parent
a05d7afe00
commit
eff1d642cf
2 changed files with 10 additions and 2 deletions
|
@ -58,8 +58,14 @@ void container.load().then((container) => {
|
||||||
const logger: winston.Logger = container.get(TYPES.Auth_Logger)
|
const logger: winston.Logger = container.get(TYPES.Auth_Logger)
|
||||||
|
|
||||||
server.setErrorConfig((app) => {
|
server.setErrorConfig((app) => {
|
||||||
app.use((error: Record<string, unknown>, _request: Request, response: Response, _next: NextFunction) => {
|
app.use((error: Record<string, unknown>, request: Request, response: Response, _next: NextFunction) => {
|
||||||
logger.error(error.stack)
|
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({
|
response.status(500).send({
|
||||||
error: {
|
error: {
|
||||||
|
|
|
@ -26,6 +26,8 @@ export class LockMiddleware extends BaseMiddleware {
|
||||||
message: usernameOrError.getError(),
|
message: usernameOrError.getError(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
const username = usernameOrError.getValue()
|
const username = usernameOrError.getValue()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue