Merge pull request #65556 from azat/dashboard-user-from-url

Parse user from URL for dashboard.html (useful for sharing)
This commit is contained in:
Alexey Milovidov 2024-07-04 00:45:07 +00:00 committed by GitHub
commit 2b3f1ef3aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -506,6 +506,14 @@ let user = 'default';
let password = ''; let password = '';
let add_http_cors_header = (location.protocol != 'file:'); let add_http_cors_header = (location.protocol != 'file:');
const current_url = new URL(window.location);
/// Substitute user name if it's specified in the query string
const user_from_url = current_url.searchParams.get('user');
if (user_from_url) {
user = user_from_url;
}
const errorCodeMessageMap = { const errorCodeMessageMap = {
516: 'Error authenticating with database. Please check your connection params and try again.' 516: 'Error authenticating with database. Please check your connection params and try again.'
} }