summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-05-27 11:37:16 -0400
committerCorey Hulen <corey@hulen.com>2016-05-27 08:37:16 -0700
commit5ff85df9e92b5ca2c5cd33d3338e3e04190b09cd (patch)
treeec5fd7183fbcf3815ee96ec51d927c63f8b86642 /webapp/actions
parentd2aacdbb07c0c0b97c0f45c99cfbbd2f28c56e7b (diff)
downloadchat-5ff85df9e92b5ca2c5cd33d3338e3e04190b09cd.tar.gz
chat-5ff85df9e92b5ca2c5cd33d3338e3e04190b09cd.tar.bz2
chat-5ff85df9e92b5ca2c5cd33d3338e3e04190b09cd.zip
Display error correctly on ldap to email claim page (#3129)
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
+ );
+}