fix: use impersonatedById (#19682)
Co-authored-by: Bailey Pumfleet <[email protected]>
This commit is contained in:
1 parent
31cd77345d
commit
b74a49f31d
1 file changed
+6
-3
@@ -95,23 +95,26 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
|
||||
exp: epochTimeFourteenDaysAfter,
|
||||
});
|
||||
|
||||
const sessionUserId = !!session?.user?.impersonatedBy ? session.user.impersonatedBy.id : session?.user.id;
|
||||
|
||||
// set meetingPassword for guests
|
||||
if (session?.user.id !== bookingObj.user?.id) {
|
||||
if (sessionUserId !== bookingObj.user?.id) {
|
||||
const guestMeetingPassword = await generateGuestMeetingTokenFromOwnerMeetingToken(
|
||||
videoReferencePassword,
|
||||
session?.user.id
|
||||
sessionUserId
|
||||
);
|
||||
|
||||
bookingObj.references.forEach((bookRef) => {
|
||||
bookRef.meetingPassword = guestMeetingPassword;
|
||||
});
|
||||
}
|
||||
|
||||
// Only for backward compatibility and setting user id in participants for organizer
|
||||
else {
|
||||
const meetingPassword = await setEnableRecordingUIAndUserIdForOrganizer(
|
||||
oldVideoReference.id,
|
||||
videoReferencePassword,
|
||||
session?.user.id
|
||||
sessionUserId
|
||||
);
|
||||
if (!!meetingPassword) {
|
||||
bookingObj.references.forEach((bookRef) => {
|
||||
|
||||
Reference in new issue
Block a user