diff options
Diffstat (limited to 'src/components/login_form')
| -rw-r--r-- | src/components/login_form/login_form.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index 1119754e..da302c76 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -26,14 +26,20 @@ const LoginForm = { this.isTokenMethod ? this.submitToken() : this.submitPassword() }, submitToken () { - oauthApi.login({ - oauth: this.oauth, + const { clientId } = this.oauth + const data = { + clientId, instance: this.instance.server, commit: this.$store.commit - }) + } + + oauthApi.getOrCreateApp(data) + .then((app) => { oauthApi.login({ ...app, ...data }) }) }, submitPassword () { + const { clientId } = this.oauth const data = { + clientId, oauth: this.oauth, instance: this.instance.server } @@ -42,7 +48,7 @@ const LoginForm = { oauthApi.getOrCreateApp(data).then((app) => { oauthApi.getTokenWithCredentials( { - app, + ...app, instance: data.instance, username: this.user.username, password: this.user.password |
