Skip to content

Commit 2b3f1ef

Browse files
Merge pull request #65556 from azat/dashboard-user-from-url
Parse user from URL for dashboard.html (useful for sharing)
2 parents 615d550 + 2991e27 commit 2b3f1ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

programs/server/dashboard.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,14 @@
506506
let password = '';
507507
let add_http_cors_header = (location.protocol != 'file:');
508508

509+
const current_url = new URL(window.location);
510+
/// Substitute user name if it's specified in the query string
511+
const user_from_url = current_url.searchParams.get('user');
512+
if (user_from_url) {
513+
user = user_from_url;
514+
}
515+
516+
509517
const errorCodeMessageMap = {
510518
516: 'Error authenticating with database. Please check your connection params and try again.'
511519
}

0 commit comments

Comments
 (0)