Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

LukasHirt
Copy link
Collaborator

Description

Opening the admin settings directly by pasting the URL in the browser address bar or opening the app in a new tab now works correctly. The redirect was not correctly using the navigation guard leading to a mismatch in users permissions. We now redirect to the first available route and leave the route itself to handle the permissions navigation guard.

Motivation and Context

Users can open admin settings by entering URL address.

How Has This Been Tested?

  • test environment: macos, chrome
  • test case 1: open admin settings on new tab
  • test case 2: open admin settings by entering URL

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

@LukasHirt LukasHirt requested review from Copilot and mzner July 2, 2025 09:34
@LukasHirt LukasHirt self-assigned this Jul 2, 2025
@LukasHirt LukasHirt added the Type:Bug Something isn't working label Jul 2, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the admin-settings routing to always redirect users to a permitted sub-route when accessing “/”, fixing the previous mismatch in permissions when opening the URL directly.

  • Extracts the redirect logic into a new getAvailableRoute helper.
  • Changes the root redirect and individual beforeEnter guards to use getAvailableRoute.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
packages/web-app-admin-settings/src/index.ts Extracted redirect logic and updated route guards
changelog/unreleased/bugfix-handle-direct-admin-settings-access.md Added bugfix entry for direct URL access
Comments suppressed due to low confidence (1)

packages/web-app-admin-settings/src/index.ts:25

  • [nitpick] Consider adding unit tests for getAvailableRoute to verify that it returns the correct route name for each permission set.
function getAvailableRoute(ability: Ability) {

…gs access

Opening the admin settings directly by pasting the URL in the browser address bar or opening the app in a new tab now works correctly.
The redirect was not correctly using the navigation guard leading to a mismatch in users permissions.
We now redirect to the first available route and leave the route itself to handle the permissions navigation guard.
@LukasHirt LukasHirt force-pushed the fix/admin-settings-direct-access branch from e931bce to c416e52 Compare July 3, 2025 08:01
Copy link

sonarqubecloud bot commented Jul 3, 2025

@LukasHirt LukasHirt enabled auto-merge July 3, 2025 08:14
@LukasHirt LukasHirt merged commit 62579fa into master Jul 3, 2025
4 checks passed
@LukasHirt LukasHirt deleted the fix/admin-settings-direct-access branch July 3, 2025 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants