diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 21:34:34 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-03-05 21:34:34 +0100 |
| commit | 88d092e21a4ea296ce804ef416683807df4b7d38 (patch) | |
| tree | 53e85f1e415cfc298f814d52029516c1a33de712 /animism-align/frontend/app/views/auth/auth.login.js | |
| parent | 0907418ce2c6ca498b02e8e514e4945d79750467 (diff) | |
change password. log in
Diffstat (limited to 'animism-align/frontend/app/views/auth/auth.login.js')
| -rw-r--r-- | animism-align/frontend/app/views/auth/auth.login.js | 16 |
1 files changed, 6 insertions, 10 deletions
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 ( <form className='login' onSubmit={this.handleSubmit}> <h6> - Welcome to the Animism Editor + {'Welcome to Animism '}{'🐍'} </h6> <TextInput title="Username" |
