fix(api-gateway): add session to response locals from web socket middleware

This commit is contained in:
Karol Sójko 2023-11-28 10:44:56 +01:00
parent bcd1d830e6
commit 4cc647ac07
No known key found for this signature in database
GPG key ID: C2F813669419D05F

View file

@ -60,6 +60,7 @@ export class WebSocketAuthMiddleware extends BaseMiddleware {
const decodedToken = <CrossServiceTokenData>verify(crossServiceToken, this.jwtSecret, { algorithms: ['HS256'] })
response.locals.user = decodedToken.user
response.locals.session = decodedToken.session
response.locals.roles = decodedToken.roles
} catch (error) {
const errorMessage = (error as AxiosError).isAxiosError