chore: stringify user context ids apiv2 axiom (#22234)
This commit is contained in:
@@ -5,10 +5,10 @@ import { Team } from "@calcom/prisma/client";
|
||||
import { ApiAuthGuardUser } from "../modules/auth/strategies/api-auth/api-auth.strategy";
|
||||
|
||||
export interface UserContext {
|
||||
userId?: number;
|
||||
userId?: string;
|
||||
userEmail?: string;
|
||||
organizationId?: number;
|
||||
teamId?: number;
|
||||
organizationId?: string;
|
||||
teamId?: string;
|
||||
}
|
||||
|
||||
export function extractUserContext(request: Request): UserContext {
|
||||
@@ -16,18 +16,18 @@ export function extractUserContext(request: Request): UserContext {
|
||||
|
||||
const user = (request as any).user as ApiAuthGuardUser | undefined;
|
||||
if (user) {
|
||||
context.userId = user.id;
|
||||
context.userId = String(user.id);
|
||||
context.userEmail = user.email;
|
||||
}
|
||||
|
||||
const organizationId = (request as any).organizationId as number | undefined;
|
||||
if (organizationId) {
|
||||
context.organizationId = organizationId;
|
||||
context.organizationId = String(organizationId);
|
||||
}
|
||||
|
||||
const team = (request as any).team as Team | undefined;
|
||||
if (team) {
|
||||
context.teamId = team.id;
|
||||
context.teamId = String(team.id);
|
||||
}
|
||||
|
||||
return context;
|
||||
|
||||
Reference in New Issue
Block a user