import React from 'react'; import PropTypes from 'prop-types'; import { CardActions, Button, Textfield } from 'react-mdl'; class SimpleAuthenticationComponent extends React.Component { static propTypes = { authDetails: PropTypes.object.isRequired, unsecureLogin: PropTypes.func.isRequired, loadInitialData: PropTypes.func.isRequired, history: PropTypes.object.isRequired, }; handleSubmit = evt => { evt.preventDefault(); const email = this.refs.email.inputRef.value; const user = { email }; const path = evt.target.action; this.props .unsecureLogin(path, user) .then(this.props.loadInitialData) .then(() => this.props.history.push(`/`)); }; render() { const authDetails = this.props.authDetails; return (
); } } export default SimpleAuthenticationComponent;