From 5ff85df9e92b5ca2c5cd33d3338e3e04190b09cd Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Fri, 27 May 2016 11:37:16 -0400 Subject: Display error correctly on ldap to email claim page (#3129) --- webapp/actions/user_actions.jsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 webapp/actions/user_actions.jsx (limited to 'webapp/actions') 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 + ); +} -- cgit v1.2.3-1-g7c22