mirror of
https://github.com/stellarshenson/stellars-jupyterhub-ds.git
synced 2026-03-07 21:50:28 +00:00
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:
@@ -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 = [];
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user