summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/user_actions.jsx22
1 files changed, 22 insertions, 0 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
new file mode 100644
index 000000000..370bfc302
--- /dev/null
+++ b/webapp/actions/user_actions.jsx
@@ -0,0 +1,22 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+import Client from 'utils/web_client.jsx';
+
+export function switchFromLdapToEmail(email, password, ldapPassword, onSuccess, onError) {
+ Client.ldapToEmail(
+ email,
+ password,
+ ldapPassword,
+ (data) => {
+ if (data.follow_link) {
+ window.location.href = data.follow_link;
+ }
+
+ if (onSuccess) {
+ onSuccess(data);
+ }
+ },
+ onError
+ );
+}