feat: add user to sentry (#3467)
* feat: wip add user to sentry * feat: wip interceptor * feat: wip add user to sentry * feat: add user into sentry errors * fix: hide stack trace in production * fix: properly log commands and handle exceptions * fix: filter command exceptions * feat: handle jobs errors
This commit is contained in:
@ -192,7 +192,10 @@ export class TokenService {
|
||||
return !!token;
|
||||
}
|
||||
|
||||
async validateToken(request: Request): Promise<Workspace> {
|
||||
async validateToken(request: Request): Promise<{
|
||||
user?: User;
|
||||
workspace: Workspace;
|
||||
}> {
|
||||
const token = ExtractJwt.fromAuthHeaderAsBearerToken()(request);
|
||||
|
||||
if (!token) {
|
||||
@ -203,11 +206,11 @@ export class TokenService {
|
||||
this.environmentService.getAccessTokenSecret(),
|
||||
);
|
||||
|
||||
const { workspace } = await this.jwtStrategy.validate(
|
||||
const { user, workspace } = await this.jwtStrategy.validate(
|
||||
decoded as JwtPayload,
|
||||
);
|
||||
|
||||
return workspace;
|
||||
return { user, workspace };
|
||||
}
|
||||
|
||||
async verifyLoginToken(loginToken: string): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user