Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/app/api/auth/forgot-password/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function handler(req: NextRequest) {

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: piiHasher.hash(ip),
identifier: `forgotPassword:${piiHasher.hash(ip)}`,
});

try {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcom/web",
"version": "5.9.11",
"version": "5.9.12",
"private": true,
"scripts": {
"analyze": "ANALYZE=true next build",
Expand Down Expand Up @@ -124,11 +124,11 @@
"posthog-node": "^5.9.5",
"qrcode": "^1.5.1",
"raw-body": "^2.5.1",
"react": "^18.2.0",
"react": "18.2.0",
"react-colorful": "^5.6.0",
"react-date-picker": "^8.3.6",
"react-digit-input": "^2.1.0",
"react-dom": "^18.2.0",
"react-dom": "18.2.0",
"react-easy-crop": "^3.5.2",
"react-hook-form": "^7.43.3",
"react-live-chat-loader": "^2.8.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/api/book/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function handler(req: NextApiRequest & { userId?: number; traceContext: Tr

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: piiHasher.hash(userIp),
identifier: `createBooking:${piiHasher.hash(userIp)}`,
});

const session = await getServerSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion apps/web/pages/api/book/recurring-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async function handler(req: NextApiRequest & RequestMeta) {

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: piiHasher.hash(userIp),
identifier: `createRecurringBooking:${piiHasher.hash(userIp)}`,
});
const session = await getServerSession({ req });
/* To mimic API behavior and comply with types */
Expand Down
41 changes: 24 additions & 17 deletions companion/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions companion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"react-native": "0.81.5",
"react-native-context-menu-view": "^1.20.0",
"react-native-gesture-handler": "^2.29.1",
"react-native-reanimated": "~3.10.1",
"react-native-reanimated": "~4.1.1",
"react-native-safe-area-context": "5.4.0",
"react-native-svg": "^15.15.0",
"react-native-web": "^0.21.2",
"react-native-worklets": "^0.6.1"
"react-native-worklets": "0.5.1"
},
"private": true,
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@
"dayjs@1.11.2": "patch:dayjs@npm%3A1.11.4#./.yarn/patches/dayjs-npm-1.11.4-97921cd375.patch",
"dayjs@^1": "patch:dayjs@npm%3A1.11.4#./.yarn/patches/dayjs-npm-1.11.4-97921cd375.patch",
"dayjs@^1.8.29": "patch:dayjs@npm%3A1.11.4#./.yarn/patches/dayjs-npm-1.11.4-97921cd375.patch",
"import-in-the-middle": "1.13.1"
"import-in-the-middle": "1.13.1",
"react@19.2.0": "19.2.1"
},
"engines": {
"npm": ">=7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/features/auth/lib/verifyEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const sendEmailVerification = async ({

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: hashEmail(email),
identifier: `sendEmailVerification:${hashEmail(email)}`,
});

await prisma.verificationToken.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ describe("RetellAIService", () => {

expect(vi.mocked(checkRateLimitAndThrowError)).toHaveBeenCalledWith({
rateLimitingType: "core",
identifier: "test-call:1",
identifier: "createTestCall:1",
});
expect(result).toEqual({
callId: "call-123",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class CallService {

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `test-call:${userId}`,
identifier: `createTestCall:${userId}`,
});

const toNumber = phoneNumber?.trim();
Expand Down Expand Up @@ -192,7 +192,7 @@ export class CallService {

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `web-call:${userId}`,
identifier: `createWebCall:${userId}`,
});

const agent = await this.deps.agentRepository.findByIdWithCallAccess({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ describe("CallService", () => {

expect(checkRateLimitAndThrowError).toHaveBeenCalledWith({
rateLimitingType: "core",
identifier: "test-call:1",
identifier: "createTestCall:1",
});
});

Expand All @@ -224,7 +224,7 @@ describe("CallService", () => {

expect(checkRateLimitAndThrowError).toHaveBeenCalledWith({
rateLimitingType: "core",
identifier: "test-call:42",
identifier: "createTestCall:42",
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ const scheduleAIPhoneCallTask = async (args: ScheduleAIPhoneCallTaskArgs) => {
if (userId) {
await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `ai-phone-call:${userId}`,
identifier: `executeAIPhoneCall:${userId}`,
});
}

Expand Down
4 changes: 2 additions & 2 deletions packages/features/tasker/tasks/executeAIPhoneCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,9 @@ export async function executeAIPhoneCall(payload: string) {
}

const rateLimitIdentifier = data.teamId
? `ai-phone-call:team:${data.teamId}`
? `executeAIPhoneCall:team-${data.teamId}`
: data.userId
? `ai-phone-call:user:${data.userId}`
? `executeAIPhoneCall:user-${data.userId}`
: null;

if (!rateLimitIdentifier) {
Expand Down
6 changes: 3 additions & 3 deletions packages/sms/sms-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ const handleSendingSMS = async ({
// If neither is provided(Just in case), we check the rate limit for the reminderPhone.
await checkSMSRateLimit({
identifier: teamId
? `handleSendingSMS:team:${teamId}`
? `handleSendingSMS:team-${teamId}`
: organizerUserId
? `handleSendingSMS:user:${organizerUserId}`
: `handleSendingSMS:user:${piiHasher.hash(reminderPhone)}`,
? `handleSendingSMS:org-user-${organizerUserId}`
: `handleSendingSMS:user-${piiHasher.hash(reminderPhone)}`,
rateLimitingType: "sms",
});

Expand Down
2 changes: 1 addition & 1 deletion packages/sms/test/sms-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe("SMSManager", () => {
const result = await smsManager.sendSMSToAttendee(mockCalEvent.attendees[0], "test-booking-uid");

expect(checkSMSRateLimit).toHaveBeenCalledWith({
identifier: "handleSendingSMS:user:1",
identifier: "handleSendingSMS:org-user-1",
rateLimitingType: "sms",
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const addSecondaryEmailHandler = async ({ ctx, input }: AddSecondaryEmail

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `addSecondaryEmail.${user.id}`,
identifier: `addSecondaryEmail:${user.id}`,
});

const existingPrimaryEmail = await prisma.user.findUnique({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const resendVerifyEmail = async ({ input, ctx }: ResendEmailOptions) => {

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `resendVerifyEmail.${ctx.user.id}`,
identifier: `resendVerifyEmail:${ctx.user.id}`,
});

let emailVerified = Boolean(ctx.user.emailVerified);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const sendVerifyEmailCode = async ({
}) => {
await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: `emailVerifyByCode.${identifier}`,
identifier: `sendVerifyEmailCode:${identifier}`,
});

return await sendEmailVerificationByCode({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const verifyCode = async ({

await checkRateLimitAndThrowError({
rateLimitingType: "core",
identifier: hashEmail(email),
identifier: `verifyCode:${hashEmail(email)}`,
});

const secret = createHash("md5")
Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4523,11 +4523,11 @@ __metadata:
posthog-node: ^5.9.5
qrcode: ^1.5.1
raw-body: ^2.5.1
react: ^18.2.0
react: 18.2.0
react-colorful: ^5.6.0
react-date-picker: ^8.3.6
react-digit-input: ^2.1.0
react-dom: ^18.2.0
react-dom: 18.2.0
react-easy-crop: ^3.5.2
react-hook-form: ^7.43.3
react-live-chat-loader: ^2.8.1
Expand Down Expand Up @@ -41582,7 +41582,7 @@ __metadata:
languageName: node
linkType: hard

"react-dom@npm:^18, react-dom@npm:^18.2.0":
"react-dom@npm:18.2.0, react-dom@npm:^18, react-dom@npm:^18.2.0":
version: 18.2.0
resolution: "react-dom@npm:18.2.0"
dependencies:
Expand Down Expand Up @@ -42135,14 +42135,7 @@ __metadata:
languageName: node
linkType: hard

"react@npm:19.2.0":
version: 19.2.0
resolution: "react@npm:19.2.0"
checksum: 33dd01bf699e1c5040eb249e0f552519adf7ee90b98c49d702a50bf23af6852ea46023a5f7f93966ab10acd7a45428fa0f193c686ecdaa7a75a03886e53ec3fe
languageName: node
linkType: hard

"react@npm:^18, react@npm:^18.2.0":
"react@npm:18.2.0, react@npm:^18, react@npm:^18.2.0":
version: 18.2.0
resolution: "react@npm:18.2.0"
dependencies:
Expand All @@ -42151,6 +42144,13 @@ __metadata:
languageName: node
linkType: hard

"react@npm:19.2.1":
version: 19.2.1
resolution: "react@npm:19.2.1"
checksum: 9b32ace5c532ed78bc5a907bfec77d966c8f117049d9bf06b627c4cebe5ef2c899f18ed283f8ed5b85346176b5ccc5328ab6fae0b389f2936a87575ce0e47670
languageName: node
linkType: hard

"read-cache@npm:^1.0.0":
version: 1.0.0
resolution: "read-cache@npm:1.0.0"
Expand Down
Loading