diff options
| author | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-06-16 11:18:21 +0000 |
|---|---|---|
| committer | HJ <30-hj@users.noreply.git.pleroma.social> | 2019-06-16 11:18:21 +0000 |
| commit | 1db3c785d805bfe1e7bb09f2d85875448cb03f9a (patch) | |
| tree | fe756a5a3d9271966e9585166fa2c0ec9e372a4e /src/components/login_form/login_form.js | |
| parent | 1fc460a7a518f9a33e5b453070dc57e9e463fda1 (diff) | |
| parent | acbeea59ff196c16e7992c80e56a638ce3a623b6 (diff) | |
Merge branch 'masto-register-app-secret' into 'develop'
Proper clientId/secret/token caching, MastoAPI registration
Closes #554
See merge request pleroma/pleroma-fe!806
Diffstat (limited to 'src/components/login_form/login_form.js')
| -rw-r--r-- | src/components/login_form/login_form.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js index 0d76af0e..93214646 100644 --- a/src/components/login_form/login_form.js +++ b/src/components/login_form/login_form.js @@ -26,23 +26,30 @@ const LoginForm = { this.isTokenAuth ? 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 + instance: this.instance.server, + commit: this.$store.commit } this.error = false oauthApi.getOrCreateApp(data).then((app) => { oauthApi.getTokenWithCredentials( { - app, + ...app, instance: data.instance, username: this.user.username, password: this.user.password |
