diff options
Diffstat (limited to 'web/react/utils/client.jsx')
-rw-r--r-- | web/react/utils/client.jsx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx index beabf5227..1c417153b 100644 --- a/web/react/utils/client.jsx +++ b/web/react/utils/client.jsx @@ -243,7 +243,7 @@ export function loginByEmail(name, email, password, success, error) { dataType: 'json', contentType: 'application/json', type: 'POST', - data: JSON.stringify({name: name, email: email, password: password}), + data: JSON.stringify({name, email, password}), success: function onSuccess(data, textStatus, xhr) { track('api', 'api_users_login_success', data.team_id, 'email', data.email); BrowserStore.signalLogin(); @@ -258,6 +258,26 @@ export function loginByEmail(name, email, password, success, error) { }); } +export function loginByLdap(teamName, id, password, success, error) { + $.ajax({ + url: '/api/v1/users/login_ldap', + dataType: 'json', + contentType: 'application/json', + type: 'POST', + data: JSON.stringify({teamName, id, password}), + success: function onSuccess(data, textStatus, xhr) { + track('api', 'api_users_loginLdap_success', data.team_id, 'id', id); + success(data, textStatus, xhr); + }, + error: function onError(xhr, status, err) { + track('api', 'api_users_loginLdap_fail', teamName, 'id', id); + + var e = handleError('loginByLdap', xhr, status, err); + error(e); + } + }); +} + export function revokeSession(altId, success, error) { $.ajax({ url: '/api/v1/users/revoke_session', @@ -1056,7 +1076,9 @@ export function getFileInfo(filename, success, error) { dataType: 'json', contentType: 'application/json', type: 'GET', - success, + success: (data) => { + success(data); + }, error: function onError(xhr, status, err) { var e = handleError('getFileInfo', xhr, status, err); error(e); |