'use strict'; import { h, render, Component } from 'preact'; import Client from '../lib/client.js'; import Notification from '../components/Notification.js'; import { bind } from 'decko'; class LoginForm extends Component { constructor(props) { super(props) this.handleSubmit = this.handleSubmit.bind(this); this.state = { email: '', password: '', message: '' } } @bind handleSubmit(e) { e.preventDefault(); Client.request('session', { method: "POST", data: { email: this.state.email, password: this.state.password, } }).then((r) => { this.props.onSuccess() }).catch((e) => { this.setState({ message: e.message, password: '' }) }) } @bind updatePassword(e) { this.setState({ password: e.target.value }); } @bind updateEmail(e) { this.setState({ email: e.target.value }); } render() { return (

Login

Please enter your login credentials to access your Fathom dashboard.

) } } export default LoginForm