From 88d092e21a4ea296ce804ef416683807df4b7d38 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Mar 2021 21:34:34 +0100 Subject: change password. log in --- animism-align/frontend/app/views/auth/auth.login.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'animism-align/frontend/app/views/auth/auth.login.js') diff --git a/animism-align/frontend/app/views/auth/auth.login.js b/animism-align/frontend/app/views/auth/auth.login.js index 9ba4c0b..6697901 100644 --- a/animism-align/frontend/app/views/auth/auth.login.js +++ b/animism-align/frontend/app/views/auth/auth.login.js @@ -22,7 +22,6 @@ export default class AuthLogin extends Component { handleChange(e) { e && e.preventDefault() - console.log(e.target.name, e.target.value) this.setState({ data: { ...this.state.data, @@ -34,14 +33,11 @@ export default class AuthLogin extends Component { handleSubmit(e) { e && e.preventDefault() this.setState({ error: null }) - actions.auth.login(this.state) - .then(res => { - console.log(res) - if (res.error) { - this.props.onAuthenticate() - } else { - this.setState({ error }) - } + actions.auth.login(this.state.data) + .then(this.props.onAuthenticate) + .catch(error => { + console.error(error) + this.setState({ error: error.description || error.message }) }) } @@ -49,7 +45,7 @@ export default class AuthLogin extends Component { return (
- Welcome to the Animism Editor + {'Welcome to Animism '}{'🐍'}