diff options
| author | shpuld <shp@cock.li> | 2019-01-28 17:43:51 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-28 17:43:51 +0200 |
| commit | 1b76a5a9eabf9e33daf83ae398295ef199607695 (patch) | |
| tree | 78512ff81129eb948cb6c206872b38a218e643e2 /src/components/login_form/login_form.js | |
| parent | 3b1cafc19fc8f094bb2469f194afab5b5464cecb (diff) | |
Add back that login error thing that someone removed
Diffstat (limited to 'src/components/login_form/login_form.js')
| -rw-r--r-- | src/components/login_form/login_form.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index 013222a8..ae9322d5 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -22,6 +22,7 @@ const LoginForm = { oauth: this.$store.state.oauth, instance: this.$store.state.instance.server } + this.clearError() oauthApi.getOrCreateApp(data).then((app) => { oauthApi.getTokenWithCredentials( { @@ -30,11 +31,19 @@ const LoginForm = { username: this.user.username, password: this.user.password}) .then((result) => { + if (result.error) { + this.authError = result.error + this.user.password = '' + return + } this.$store.commit('setToken', result.access_token) this.$store.dispatch('loginUser', result.access_token) this.$router.push({name: 'friends'}) }) }) + }, + clearError () { + this.authError = false } } } |
