LDAP: fix LDAP test with special chars in username (#26539)

This commit is contained in:
Agnès Toulet 2020-07-23 12:42:30 +02:00 committed by GitHub
parent 1ba95183f6
commit 2e931a0ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,7 +211,7 @@ export function loadLdapState(): ThunkResult<void> {
export function loadUserMapping(username: string): ThunkResult<void> {
return async dispatch => {
try {
const response = await getBackendSrv().get(`/api/admin/ldap/${username}`);
const response = await getBackendSrv().get(`/api/admin/ldap/${encodeURIComponent(username)}`);
const { name, surname, email, login, isGrafanaAdmin, isDisabled, roles, teams } = response;
const userInfo: LdapUser = {
info: { name, surname, email, login },