Refactor flow entering guest name and guest access - #3275
Conversation
…ring-guest-name-and-guest-access
…ring-guest-name-and-guest-access
…ring-guest-name-and-guest-access
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThis PR reworks guest room entry with a dedicated access overlay, shared participant-name validation, remembered guest names, hash-based access-code and personalized-link handling, invalid tab-hash cleanup, updated translations, and extensive frontend and system test coverage. ChangesGuest Access and Room Link Flow
Estimated code review effort: 4 (Complex) | ~75 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3275 +/- ##
=============================================
- Coverage 97.11% 97.10% -0.02%
- Complexity 1948 1951 +3
=============================================
Files 483 486 +3
Lines 16654 16867 +213
Branches 2408 2451 +43
=============================================
+ Hits 16174 16378 +204
- Misses 480 489 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PILOS
|
||||||||||||||||||||||||||||||||||
| Project |
PILOS
|
| Branch Review |
refactor-flow-entering-guest-name-and-guest-access
|
| Run status |
|
| Run duration | 08m 05s |
| Commit |
|
| Committer | Sabrina Wüst |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
1
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
651
|
| View all changes introduced in this branch ↗︎ | |
Tests for review

e2e/RoomsJoinWithLobby.cy.js • 1 failed test • System tests
| Test | Artifacts | |
|---|---|---|
| Room Join with lobby settings > Lobby enabled for guests only |
Test Replay
Screenshots
|
|
…ring-guest-name-and-guest-access # Conflicts: # resources/js/components/RoomHeader.vue # resources/js/views/RoomsView.vue
…ring-guest-name-and-guest-access # Conflicts: # tests/Frontend/e2e/RoomsViewGeneral.cy.js
…ring-guest-name-and-guest-access
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (2)
app/Http/Requests/ValidateParticipantNameRequest.php (1)
12-17: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: document the rules() return shape.
Straightforward and correct; omitting
authorize()is fine here since this codebase's Laravel 11+FormRequest::passesAuthorization()defaults totrue. As a nitpick, per coding guidelines you could add a PHPDoc array-shape annotation forrules()'s return value for consistency with the rest of the codebase.As per coding guidelines: "Use array shape type definitions in PHPDoc blocks."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/Http/Requests/ValidateParticipantNameRequest.php` around lines 12 - 17, Add a PHPDoc array-shape annotation for the ValidateParticipantNameRequest::rules() return value to match the codebase guideline on documenting array shapes. Keep the existing validation logic unchanged, and place the docblock directly above rules() so the shape of the returned array is explicit for future readers and static analysis.Source: Coding guidelines
resources/js/components/RoomAccessOverlay.vue (1)
94-127: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDuplicated error-block markup uses raw Tailwind colors instead of PrimeVue tokens.
The
authThrottledForandaccessCodeInvaliderror blocks are near-identical (same classes/structure, different message) and both use raw Tailwind palette colors (text-red-500 dark:text-red-300) rather than PrimeVue color tokens. Consider consolidating into one block driven by a computed message, and switching to PrimeVue's semantic error/danger color tokens for design consistency.As per path instructions: "Use PrimeVue color tokens instead of custom colors to maintain design consistency."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@resources/js/components/RoomAccessOverlay.vue` around lines 94 - 127, The two alert blocks in RoomAccessOverlay.vue are duplicated and both hardcode Tailwind red classes, so simplify this section by using a single error block driven by a computed/current error message instead of separate authThrottledFor and accessCodeInvalid branches. Update the shared markup to use PrimeVue semantic error/danger tokens rather than text-red-500 and dark:text-red-300, keeping the same structure and formError ref/role behavior. Use the existing conditionals and message sources in RoomAccessOverlay.vue to determine which message to render, but avoid repeating the entire block.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@resources/js/components/RoomAccessOverlay.vue`:
- Around line 94-126: The `formError` focus hook in `RoomAccessOverlay.vue` is
unused, so the alert never receives programmatic focus when `authThrottledFor`
or `accessCodeInvalid` appears. Add a `formError` ref in `<script setup>`, then
use the existing `ref="formError"` on the error alert blocks to focus the
element when either error state becomes visible (for example via a watcher or
after the submit/error state updates). Keep the fix aligned with the access-code
flow in `RoomAccessOverlay` so the alert announcement behavior is restored for
screen-reader and keyboard users.
- Around line 2-13: The Badge sizing in RoomAccessOverlay.vue is using Tailwind
v3 important classes, so update the Badge class on the header icon wrapper to
Tailwind v4 important syntax using the suffix form instead of the prefix form.
Locate the Badge inside the RoomAccessOverlay.vue template and replace the
existing size utilities so the dimensions still override PrimeVue defaults while
remaining compatible with Tailwind v4.
In `@resources/js/views/RoomsView.vue`:
- Around line 571-572: initializeRoomView() currently keeps running after
loadSavedAccessParameters() redirects authenticated users away from guest-only
links, which can still lead to load() being called; update
loadSavedAccessParameters() to return a boolean indicating whether it
redirected, and in initializeRoomView() exit early when that return value shows
the redirect happened. Use the existing loadSavedAccessParameters and
initializeRoomView symbols to keep the control flow clear and prevent any
post-redirect initialization.
- Around line 678-689: The credential persistence in RoomsView.vue leaves the
previously stored alternate token behind, so a new access code can be
overshadowed by an old personalized link on reload. Update the save logic around
the room auth token handling to clear the other sessionStorage entry whenever
one credential type is written: in the personalized-link branch remove the
roomAccessCode_${props.id} item, and in the roomAuthToken.value.type ===
ROOM_AUTH_TOKEN_TYPE_CODE branch remove the roomPersonalizedLink_${props.id}
item.
In `@routes/api.php`:
- Around line 179-182: The new public participantName.check endpoint is missing
the same abuse protection used by the other guest routes. Add an appropriate
throttle middleware to the Route::post('participantName/check') definition in
routes/api.php, following the pattern already used for login/local, login/ldap,
password/reset, password/email, and the rooms/{room}/auth group so
ValidateParticipantNameRequest remains rate-limited.
In `@tests/Frontend/support/commands/roomCommands.js`:
- Around line 162-166: The guest-login flow in roomCommands.js is missing a stub
for api/v1/participantName/check, so the `#participant-name` to room-login-button
path can hit the real backend. Update the guest-login helper used by
cy.init()/cy.interceptRoomViewRequests() to reuse
setValidRememberedParticipantName(), or add the intercept directly in the
guest-login step before typing the name, so the participant name check is always
mocked.
---
Nitpick comments:
In `@app/Http/Requests/ValidateParticipantNameRequest.php`:
- Around line 12-17: Add a PHPDoc array-shape annotation for the
ValidateParticipantNameRequest::rules() return value to match the codebase
guideline on documenting array shapes. Keep the existing validation logic
unchanged, and place the docblock directly above rules() so the shape of the
returned array is explicit for future readers and static analysis.
In `@resources/js/components/RoomAccessOverlay.vue`:
- Around line 94-127: The two alert blocks in RoomAccessOverlay.vue are
duplicated and both hardcode Tailwind red classes, so simplify this section by
using a single error block driven by a computed/current error message instead of
separate authThrottledFor and accessCodeInvalid branches. Update the shared
markup to use PrimeVue semantic error/danger tokens rather than text-red-500 and
dark:text-red-300, keeping the same structure and formError ref/role behavior.
Use the existing conditionals and message sources in RoomAccessOverlay.vue to
determine which message to render, but avoid repeating the entire block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: b0950a24-c392-40cc-9f01-ababbbe34cff
📒 Files selected for processing (43)
CHANGELOG.mdapp/Http/Requests/ValidateParticipantNameRequest.phplang/en/app.phplang/en/auth.phplang/en/rooms.phpresources/js/components/RoomAccessOverlay.vueresources/js/components/RoomBBBMessage.vueresources/js/components/RoomHeader.vueresources/js/components/RoomJoinButton.vueresources/js/components/RoomParticipantNameChangeButton.vueresources/js/components/RoomShareButton.vueresources/js/components/RoomTabHistory.vueresources/js/components/RoomTabPersonalizedLinksCopyButton.vueresources/js/components/RoomTabRecordings.vueresources/js/components/RoomTabSection.vueresources/js/components/RoomTabSettings.vueresources/js/components/RoomTabStreaming.vueresources/js/components/UserTabSection.vueresources/js/composables/useRoomHelpers.jsresources/js/router.jsresources/js/views/RoomsView.vueroutes/api.phptests/Backend/Feature/api/v1/Room/RoomTest.phptests/Frontend/e2e/AdminUsersEdit.cy.jstests/Frontend/e2e/AdminUsersView.cy.jstests/Frontend/e2e/RoomsViewAccess.cy.jstests/Frontend/e2e/RoomsViewDescription.cy.jstests/Frontend/e2e/RoomsViewFiles.cy.jstests/Frontend/e2e/RoomsViewFilesFileActions.cy.jstests/Frontend/e2e/RoomsViewGeneral.cy.jstests/Frontend/e2e/RoomsViewHistory.cy.jstests/Frontend/e2e/RoomsViewMeetings.cy.jstests/Frontend/e2e/RoomsViewMembers.cy.jstests/Frontend/e2e/RoomsViewPersonalizedLinks.cy.jstests/Frontend/e2e/RoomsViewPersonalizedLinksTokenActions.cy.jstests/Frontend/e2e/RoomsViewRecordings.cy.jstests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.jstests/Frontend/e2e/RoomsViewSettings.cy.jstests/Frontend/e2e/UserProfile.cy.jstests/Frontend/fixtures/config.jsontests/Frontend/support/commands/roomCommands.jstests/System/e2e/RoomsJoinWithLobby.cy.jstests/System/e2e/RoomsViewGeneral.cy.js
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@resources/js/components/RoomAccessOverlay.vue`:
- Line 91: The InputMask key handler is triggering submit twice because
`@keydown.enter="submit"` runs alongside the form’s `@submit="submit"` behavior.
Update `RoomAccessOverlay.vue` by changing the `@keydown.enter` binding on the
input element to prevent the default Enter action so only one submit path runs.
Keep the fix localized to the existing `submit()` flow and the `@keydown.enter`
handler.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6dbdd51e-d917-43be-97f6-b6156b037b3b
📒 Files selected for processing (12)
app/Http/Requests/JoinMeetingRequest.phpapp/Http/Requests/StartMeetingRequest.phpapp/Http/Requests/ValidateParticipantNameRequest.phpresources/js/components/RoomAccessOverlay.vueresources/js/components/RoomTabDescription.vueresources/js/components/RoomTabFiles.vueresources/js/components/RoomTabHistory.vueresources/js/components/RoomTabMembers.vueresources/js/components/RoomTabPersonalizedLinks.vueresources/js/components/RoomTabRecordings.vueresources/js/components/RoomTabSection.vueresources/js/views/RoomsView.vue
✅ Files skipped from review due to trivial changes (6)
- resources/js/components/RoomTabMembers.vue
- resources/js/components/RoomTabDescription.vue
- resources/js/components/RoomTabFiles.vue
- resources/js/components/RoomTabRecordings.vue
- resources/js/components/RoomTabPersonalizedLinks.vue
- resources/js/components/RoomTabHistory.vue
🚧 Files skipped from review as they are similar to previous changes (3)
- app/Http/Requests/ValidateParticipantNameRequest.php
- resources/js/components/RoomTabSection.vue
- resources/js/views/RoomsView.vue
| v-if="room.last_meeting?.detached" | ||
| severity="warn" | ||
| icon="fa-solid fa-unlink" | ||
| :class=" |
There was a problem hiding this comment.
Unsure about this. Could be move this to the parent div or increase the gap there?
| EventBus.on(EVENT_FORBIDDEN, reload); | ||
| EventBus.on(EVENT_UNAUTHORIZED, reload); | ||
|
|
||
| initializeRoomView(); |
There was a problem hiding this comment.
We could add an eventListener to detect user-triggered changes to the hash.
If the hash is changed via hashParams the event is not triggered (https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event)
Currently if the page is already loaded and we get an auth error, e.g. in the meantime an access code has been added or changes, we cannot copy the new url and paste it in the url
window.addEventListener("hashchange", () => {
console.log(hashParams.accessCode);
});
samuelwei
left a comment
There was a problem hiding this comment.
RoomView.vue Review still pending due to its complexity
Co-authored-by: Samuel Weirich <4281791+samuelwei@users.noreply.github.com>
Co-authored-by: Samuel Weirich <4281791+samuelwei@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the guest onboarding and room access flow by moving guest-name entry into a dedicated room access overlay, adding “remember guest name” behavior, and supporting access credentials (access code / personalized link) via URL hash + sessionStorage to persist access across reloads.
Changes:
- Introduces a new
RoomAccessOverlay+ guest participant-name validation endpoint and updates room join/start flows to consume the participant name from the room view state. - Moves personalized-link tokens and access codes to hash parameters (with legacy route compatibility), and persists them in sessionStorage for reload resilience.
- Expands/adjusts Cypress E2E coverage and adds backend validation tests for participant-name rules.
Reviewed changes
Copilot reviewed 51 out of 52 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/System/e2e/RoomsViewGeneral.cy.js | Updates system E2E selectors/flow for new access overlay. |
| tests/System/e2e/RoomsJoinWithLobby.cy.js | Adjusts join flow by pre-seeding remembered guest name. |
| tests/Frontend/support/commands/roomCommands.js | Updates shared Cypress room commands for new overlay and access persistence. |
| tests/Frontend/support/commands/generalCommands.js | Adds Cypress helper for reloading with a hash. |
| tests/Frontend/fixtures/config.json | Adds allowed_name_characters to fixture config. |
| tests/Frontend/e2e/UserProfile.cy.js | Updates invalid tab-hash behavior expectations. |
| tests/Frontend/e2e/RoomsViewSettings.cy.js | Updates overlay selector assertions. |
| tests/Frontend/e2e/RoomsViewRecordingsRecordingActions.cy.js | Updates recordings actions flows for hash-based access code / remembered guest name. |
| tests/Frontend/e2e/RoomsViewRecordings.cy.js | Updates recordings flows for hash-based access code / personalized link. |
| tests/Frontend/e2e/RoomsViewPersonalizedLinksTokenActions.cy.js | Updates expected copied personalized-link URL format. |
| tests/Frontend/e2e/RoomsViewPersonalizedLinks.cy.js | Updates access overlay interactions and tab-hash expectations. |
| tests/Frontend/e2e/RoomsViewMembers.cy.js | Updates access overlay interactions and tab-hash expectations. |
| tests/Frontend/e2e/RoomsViewMeetings.cy.js | Updates meeting join/start flows to use remembered participant name and hash access parameters. |
| tests/Frontend/e2e/RoomsViewHistory.cy.js | Updates access overlay interactions and tab-hash expectations. |
| tests/Frontend/e2e/RoomsViewFilesFileActions.cy.js | Updates file actions flows for hash-based access code and overlay. |
| tests/Frontend/e2e/RoomsViewFiles.cy.js | Updates files flows for hash-based access code and personalized link. |
| tests/Frontend/e2e/RoomsViewDescription.cy.js | Seeds remembered participant name for guest flows. |
| tests/Frontend/e2e/RoomsViewAccessPersonalizedLink.cy.js | New E2E coverage for hash/sessionStorage personalized-link access. |
| tests/Frontend/e2e/RoomsViewAccessParticipantName.cy.js | New E2E coverage for participant-name validation and remembered-name behavior. |
| tests/Frontend/e2e/RoomsViewAccess.cy.js | New E2E coverage for the overall room access overlay guest flow. |
| tests/Frontend/e2e/AdminUsersView.cy.js | Updates invalid tab-hash behavior expectations. |
| tests/Frontend/e2e/AdminUsersEdit.cy.js | Updates invalid tab-hash behavior expectations. |
| tests/Backend/Feature/api/v1/Room/RoomTest.php | Adds backend feature test coverage for participant-name validation. |
| routes/api.php | Adds participantName/check validation endpoint. |
| resources/js/views/RoomsView.vue | Refactors room access flow: overlay, hash params, sessionStorage persistence, guest-name state. |
| resources/js/router.js | Removes token route param from rooms view; adds legacy redirect route to hash-based token. |
| resources/js/composables/useRoomHelpers.js | Minor formatting/noise change. |
| resources/js/components/UserTabSection.vue | Clears invalid tab hash (user tabs) on mount. |
| resources/js/components/RoomTabSection.vue | Clears invalid room tab hash on mount; minor layout tweaks. |
| resources/js/components/RoomTabRecordings.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomTabPersonalizedLinksCopyButton.vue | Updates copied link to hash-based personalized-link token. |
| resources/js/components/RoomTabPersonalizedLinks.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomTabMembers.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomTabHistory.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomTabFiles.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomTabDescription.vue | Minor layout tweaks (padding changes). |
| resources/js/components/RoomShareButton.vue | Includes access code in share link hash when applicable. |
| resources/js/components/RoomParticipantNameChangeButton.vue | New guest UI to change/remember participant name with validation. |
| resources/js/components/RoomJoinButton.vue | Removes guest-name input from join dialog; uses participant name passed in from room view. |
| resources/js/components/RoomHeader.vue | Moves connection warning notes out of header; minor spacing tweaks. |
| resources/js/components/RoomBBBMessage.vue | Minor spacing tweaks. |
| resources/js/components/RoomAccessOverlay.vue | New access overlay component for guest name + access code + login CTA. |
| lang/en/rooms.php | Adds/updates strings for guest onboarding and name management. |
| lang/en/auth.php | Adds login CTA label string. |
| lang/en/app.php | Adds “or” translation used in overlay. |
| CHANGELOG.md | Documents the new guest name/access persistence behavior. |
| app/Http/Requests/ValidateParticipantNameRequest.php | New FormRequest encapsulating participant-name validation rules. |
| app/Http/Requests/StartMeetingRequest.php | Reuses participant-name validation rules via new request helper. |
| app/Http/Requests/JoinMeetingRequest.php | Reuses participant-name validation rules via new request helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| .then(() => { | ||
| cy.reload(); | ||
| }); |
| watch(participantName, (value) => { | ||
| participantNameInput.value = value; | ||
| }); |
| */ | ||
| function handleInvalidPersonalizedLink() { | ||
| // Show error message | ||
| tokenInvalid.value = true; |
There was a problem hiding this comment.
| tokenInvalid.value = true; | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); |
Unsure about the behavior when entering an invalid personalized room link.
Before this PR the user could paste the regular room url to load without a personalized link.
With the PR the user cannot paste the regular room url, the invalid personalized link is persisted in the local storage.
The only option to successfully load the room is either pasting a new valid personalized link or a link with an access code.
There was a problem hiding this comment.
Not persisting the personalized link in the session storage could lead to the following problem (because the hash is cleared):
- User tries to enter the room with an invalid personalized link
- Error message is shown that the personalized link is invalid
- User reloads the whole page => User enters the room as "normal" guest instead of the personalized link without noticing it (especially if the room does not have an access code)
Because of that the personalized link is currently persisted to make sure that the user does not "change" to the "normal" guest access without noticing it / intending to do so if I remember it correctly
An alternative approach could maybe be to keep the personalized link in the hash and only clear it after the auth request was successfull
Another possible solution I thought about was maybe offering an explicit way to change to the "normal" guest access on the error page
There was a problem hiding this comment.
Fair point, maybe adding a new route to redirect users to? I'll try it
| async function loadSavedAccessParameters() { | ||
| // Load personalized link from hash params | ||
| if (hashParams.personalizedLink) { | ||
| personalizedLink.value = hashParams.personalizedLink; | ||
|
|
||
| sessionStorage.setItem( | ||
| "roomPersonalizedLink_" + props.id, | ||
| hashParams.personalizedLink, | ||
| ); | ||
|
|
||
| // Clear hash params | ||
| await nextTick(); | ||
| hashParams.personalizedLink = null; | ||
|
|
||
| // Treat a personalized link from the hash as the selected credential | ||
| // discard any competing hash access code so it cannot win on a later reload when | ||
| // the personalized link is only stored in session storage | ||
| hashParams.accessCode = null; | ||
| return; | ||
| } | ||
|
|
||
| // Load Access Parameters stored in hash params | ||
| if (hashParams.accessCode) { | ||
| accessCodeInput.value = hashParams.accessCode; | ||
| // Set access code param in session storage to make sure that access code | ||
| // stays set if the user decides to log in (navigates to login page) | ||
| sessionStorage.setItem("roomAccessCode_" + props.id, hashParams.accessCode); | ||
|
|
||
| // Treat an access code from the hash as the selected credential | ||
| // discard any saved personalized link so it cannot win on a later reload when | ||
| // the access code is only stored in session storage | ||
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | ||
|
|
||
| // Clear hash params | ||
| await nextTick(); | ||
| hashParams.accessCode = null; | ||
| } | ||
|
|
||
| // Load Access Parameters stored in session storage only if parameters are not already set by hash params | ||
| if (accessCodeInput.value === "") { | ||
| const savedPersonalizedLink = sessionStorage.getItem( | ||
| "roomPersonalizedLink_" + props.id, | ||
| ); | ||
| if (savedPersonalizedLink) { | ||
| if (authStore.isAuthenticated) { | ||
| // User is authenticated and not allowed to use personalized link, remove it from session storage | ||
| // and continue without loading the existing personalized link | ||
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | ||
| } else { | ||
| personalizedLink.value = savedPersonalizedLink; | ||
| return; | ||
| } | ||
| } | ||
|
|
||
| const savedAccessCode = sessionStorage.getItem( | ||
| "roomAccessCode_" + props.id, | ||
| ); | ||
|
|
||
| if (savedAccessCode) { | ||
| accessCodeInput.value = savedAccessCode; | ||
| } | ||
| } | ||
|
|
||
| if (!authStore.isAuthenticated) { | ||
| await loadSavedGuestName(); | ||
| } | ||
| } |
There was a problem hiding this comment.
| async function loadSavedAccessParameters() { | |
| // Load personalized link from hash params | |
| if (hashParams.personalizedLink) { | |
| personalizedLink.value = hashParams.personalizedLink; | |
| sessionStorage.setItem( | |
| "roomPersonalizedLink_" + props.id, | |
| hashParams.personalizedLink, | |
| ); | |
| // Clear hash params | |
| await nextTick(); | |
| hashParams.personalizedLink = null; | |
| // Treat a personalized link from the hash as the selected credential | |
| // discard any competing hash access code so it cannot win on a later reload when | |
| // the personalized link is only stored in session storage | |
| hashParams.accessCode = null; | |
| return; | |
| } | |
| // Load Access Parameters stored in hash params | |
| if (hashParams.accessCode) { | |
| accessCodeInput.value = hashParams.accessCode; | |
| // Set access code param in session storage to make sure that access code | |
| // stays set if the user decides to log in (navigates to login page) | |
| sessionStorage.setItem("roomAccessCode_" + props.id, hashParams.accessCode); | |
| // Treat an access code from the hash as the selected credential | |
| // discard any saved personalized link so it cannot win on a later reload when | |
| // the access code is only stored in session storage | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | |
| // Clear hash params | |
| await nextTick(); | |
| hashParams.accessCode = null; | |
| } | |
| // Load Access Parameters stored in session storage only if parameters are not already set by hash params | |
| if (accessCodeInput.value === "") { | |
| const savedPersonalizedLink = sessionStorage.getItem( | |
| "roomPersonalizedLink_" + props.id, | |
| ); | |
| if (savedPersonalizedLink) { | |
| if (authStore.isAuthenticated) { | |
| // User is authenticated and not allowed to use personalized link, remove it from session storage | |
| // and continue without loading the existing personalized link | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | |
| } else { | |
| personalizedLink.value = savedPersonalizedLink; | |
| return; | |
| } | |
| } | |
| const savedAccessCode = sessionStorage.getItem( | |
| "roomAccessCode_" + props.id, | |
| ); | |
| if (savedAccessCode) { | |
| accessCodeInput.value = savedAccessCode; | |
| } | |
| } | |
| if (!authStore.isAuthenticated) { | |
| await loadSavedGuestName(); | |
| } | |
| } | |
| async function loadSavedAccessParameters() { | |
| if (!authStore.isAuthenticated) { | |
| await loadSavedGuestName(); | |
| } | |
| // Load personalized link from hash params | |
| if (hashParams.personalizedLink) { | |
| personalizedLink.value = hashParams.personalizedLink; | |
| sessionStorage.setItem( | |
| "roomPersonalizedLink_" + props.id, | |
| hashParams.personalizedLink, | |
| ); | |
| // Clear hash params | |
| await nextTick(); | |
| hashParams.personalizedLink = null; | |
| // Treat a personalized link from the hash as the selected credential | |
| // discard any competing hash access code so it cannot win on a later reload when | |
| // the personalized link is only stored in session storage | |
| hashParams.accessCode = null; | |
| return; | |
| } | |
| // Load Access Parameters stored in hash params | |
| if (hashParams.accessCode) { | |
| accessCodeInput.value = hashParams.accessCode; | |
| // Set access code param in session storage to make sure that access code | |
| // stays set if the user decides to log in (navigates to login page) | |
| sessionStorage.setItem("roomAccessCode_" + props.id, hashParams.accessCode); | |
| // Treat an access code from the hash as the selected credential | |
| // discard any saved personalized link so it cannot win on a later reload when | |
| // the access code is only stored in session storage | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | |
| // Clear hash params | |
| await nextTick(); | |
| hashParams.accessCode = null; | |
| return; | |
| } | |
| // Load Access Parameters stored in session storage only if parameters are not already set by hash params | |
| if (accessCodeInput.value === "") { | |
| const savedPersonalizedLink = sessionStorage.getItem( | |
| "roomPersonalizedLink_" + props.id, | |
| ); | |
| if (savedPersonalizedLink) { | |
| if (authStore.isAuthenticated) { | |
| // User is authenticated and not allowed to use personalized link, remove it from session storage | |
| // and continue without loading the existing personalized link | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | |
| } else { | |
| personalizedLink.value = savedPersonalizedLink; | |
| return; | |
| } | |
| const savedPersonalizedLink = sessionStorage.getItem( | |
| "roomPersonalizedLink_" + props.id, | |
| ); | |
| if (savedPersonalizedLink) { | |
| if (authStore.isAuthenticated) { | |
| // User is authenticated and not allowed to use personalized link, remove it from session storage | |
| // and continue without loading the existing personalized link | |
| sessionStorage.removeItem("roomPersonalizedLink_" + props.id); | |
| } else { | |
| personalizedLink.value = savedPersonalizedLink; | |
| } | |
| const savedAccessCode = sessionStorage.getItem( | |
| "roomAccessCode_" + props.id, | |
| ); | |
| if (savedAccessCode) { | |
| accessCodeInput.value = savedAccessCode; | |
| } | |
| return; | |
| } | |
| if (!authStore.isAuthenticated) { | |
| await loadSavedGuestName(); | |
| const savedAccessCode = sessionStorage.getItem("roomAccessCode_" + props.id); | |
| if (savedAccessCode) { | |
| accessCodeInput.value = savedAccessCode; | |
| } | |
| } |
- Move loadSavedGuestName to the top, always load the name from storage
- Return after each step, removed complex nested code flows
Fixes #2450
Type
Checklist
Changes
Other information
Summary by CodeRabbit