fix: URL handling in admin fetch interceptor and nav links

- Handle URL objects (not just strings) in fetch interceptor
- Strip query params before checking isUserCreation endpoint
- Remove duplicate 'hub' prefix from authorize/change-password links
This commit is contained in:
stellarshenson
2026-01-06 20:52:12 +01:00
parent 7ee223b193
commit d5cfbebed5
2 changed files with 6 additions and 4 deletions

View File

@@ -79,8 +79,10 @@
console.log('[Admin Fetch]', method, url);
// Check for user creation
const isUserCreation = method === 'POST' && url.includes('api/users') && !url.includes('?');
// Check for user creation - POST to api/users (may have ?_xsrf query param)
// Exclude URLs with other query params like include_stopped_servers
const urlPath = url.split('?')[0];
const isUserCreation = method === 'POST' && urlPath.endsWith('api/users');
// Capture request body before fetch (for batch user creation)
let requestUsernames = [];

View File

@@ -151,11 +151,11 @@
<a class="nav-link" href="{{ base_url }}admin">Admin</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ base_url }}hub/authorize">Authorize Users</a>
<a class="nav-link" href="{{ base_url }}authorize">Authorize Users</a>
</li>
{% endif %}
<li class="nav-item">
<a class="nav-link" href="{{ base_url }}hub/change-password">Change Password</a>
<a class="nav-link" href="{{ base_url }}change-password">Change Password</a>
</li>
{% if services %}
<li class="nav-item dropdown">