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/components/claim/components/ldap_to_email.jsx | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'webapp/components') 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) { -- cgit v1.2.3-1-g7c22