frontend: include redirect URL removal from session storage in clearRoomSessionGuard

This commit is contained in:
juancarmore 2026-02-16 10:50:16 +01:00
parent 4f96192cc6
commit d55cf45fa5
3 changed files with 16 additions and 8 deletions

View File

@ -6,7 +6,7 @@ import { RoomMemberContextService } from '../../room-members/services/room-membe
/**
* Guard that clears room-related session data when entering console routes.
* This ensures roomSecret, e2eeData, room member and meeting context are only removed when navigating to console,
* This ensures session storage data, and room member and meeting context are only removed when navigating to console,
* not when leaving a meeting to go to other non-console pages (like disconnected, room recordings, etc.)
*/
export const clearRoomSessionGuard: CanActivateFn = () => {
@ -21,6 +21,7 @@ export const clearRoomSessionGuard: CanActivateFn = () => {
// Clear room-related data from session storage
sessionStorageService.removeRoomSecret();
sessionStorageService.removeE2EEData();
sessionStorageService.removeRedirectUrl();
return true;
};

View File

@ -31,6 +31,11 @@ export const extractRoomParamsGuard: CanActivateFn = (route: ActivatedRouteSnaps
meetingContextService.setRoomSecret(secret, true);
}
// If the showOnlyRecordings flag is set, redirect to the recordings page for the room
if (showOnlyRecordings === 'true') {
return navigationService.createRedirectionTo(`/room/${roomId}/recordings`);
}
// Handle E2EE key: prioritize query param, fallback to storage
if (queryE2eeKey) {
// E2EE key came from URL parameter
@ -49,10 +54,5 @@ export const extractRoomParamsGuard: CanActivateFn = (route: ActivatedRouteSnaps
roomMemberContextService.loadParticipantNameFromStorage();
}
// If the showOnlyRecordings flag is set, redirect to the recordings page for the room
if (showOnlyRecordings === 'true') {
return navigationService.createRedirectionTo(`/room/${roomId}/recordings`);
}
return true;
};

View File

@ -31,7 +31,7 @@ export class SessionStorageService {
}
/**
* Removes the room secret.
* Removes the stored room secret.
*/
public removeRoomSecret(): void {
this.remove(this.ROOM_SECRET_KEY);
@ -55,6 +55,13 @@ export class SessionStorageService {
return this.get<string>(this.REDIRECT_URL_KEY);
}
/**
* Removes the stored redirect URL.
*/
public removeRedirectUrl(): void {
this.remove(this.REDIRECT_URL_KEY);
}
/**
* Stores the E2EE key data (key and origin flag).
*
@ -75,7 +82,7 @@ export class SessionStorageService {
}
/**
* Removes the E2EE key data.
* Removes the stored E2EE key data.
*/
public removeE2EEData(): void {
this.remove(this.E2EE_DATA_KEY);