summaryrefslogtreecommitdiffstats
path: root/webapp/components/claim
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/components/claim
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/components/claim')
-rw-r--r--webapp/components/claim/components/ldap_to_email.jsx17
1 files changed, 7 insertions, 10 deletions
diff --git a/webapp/components/claim/components/ldap_to_email.jsx b/webapp/components/claim/components/ldap_to_email.jsx
index 043e043d3..fbc8bcebf 100644
--- a/webapp/components/claim/components/ldap_to_email.jsx
+++ b/webapp/components/claim/components/ldap_to_email.jsx
@@ -2,7 +2,8 @@
// See License.txt for license information.
import * as Utils from 'utils/utils.jsx';
-import Client from 'utils/web_client.jsx';
+
+import {switchFromLdapToEmail} from 'actions/user_actions.jsx';
import React from 'react';
import ReactDOM from 'react-dom';
@@ -16,6 +17,7 @@ export default class LDAPToEmail extends React.Component {
this.state = {};
}
+
submit(e) {
e.preventDefault();
var state = {};
@@ -44,20 +46,15 @@ export default class LDAPToEmail extends React.Component {
state.error = null;
this.setState(state);
- Client.ldapToEmail(
+ switchFromLdapToEmail(
this.props.email,
password,
ldapPassword,
- (data) => {
- if (data.follow_link) {
- window.location.href = data.follow_link;
- }
- },
- (error) => {
- this.setState({error});
- }
+ null,
+ (err) => this.setState({error: err.message})
);
}
+
render() {
var error = null;
if (this.state.error) {