fix: wrong credentials (#25394)
This commit is contained in:
1 parent
a09dfe37a1
commit
e06249d2df
2 files changed
+8
-3
No files matched your search
@@ -73,6 +73,7 @@ describe("confirmHandler", () => {
|
||||
location: "integrations:daily",
|
||||
attendees: [attendeeUser],
|
||||
responses: { name: attendeeUser.name, email: attendeeUser.email, notes: "Sensitive information" },
|
||||
user: { id: organizer.id },
|
||||
},
|
||||
],
|
||||
organizer,
|
||||
|
||||
@@ -45,7 +45,6 @@ type ConfirmOptions = {
|
||||
};
|
||||
|
||||
export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
const { user } = ctx;
|
||||
const {
|
||||
bookingId,
|
||||
recurringEventId,
|
||||
@@ -139,12 +138,17 @@ export const confirmHandler = async ({ ctx, input }: ConfirmOptions) => {
|
||||
},
|
||||
});
|
||||
|
||||
const user = booking.user;
|
||||
if (!user) {
|
||||
throw new TRPCError({ code: "BAD_REQUEST", message: "Booking must have an organizer" });
|
||||
}
|
||||
|
||||
await checkIfUserIsAuthorizedToConfirmBooking({
|
||||
eventTypeId: booking.eventTypeId,
|
||||
loggedInUserId: user.id,
|
||||
loggedInUserId: ctx.user.id,
|
||||
teamId: booking.eventType?.teamId || booking.eventType?.parent?.teamId,
|
||||
bookingUserId: booking.userId,
|
||||
userRole: user.role,
|
||||
userRole: ctx.user.role,
|
||||
});
|
||||
|
||||
// Do not move this before authorization check.
|
||||
|
||||
Reference in new issue
Block a user