aboutsummaryrefslogtreecommitdiff
path: root/src/components/oauth_callback/oauth_callback.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2018-11-26 05:21:58 +0300
committerHenry Jameson <me@hjkos.com>2018-11-26 05:21:58 +0300
commita806d43f05ddded69a00156bc31fe33806426ecb (patch)
treeafa9a3f43043bbce92739fb48d048605e0c45c2b /src/components/oauth_callback/oauth_callback.js
parent08838774e41b9beba8f884da15ab1314eddf28f8 (diff)
parent91272dc5558e1326dac872f927dc8da7f9109cd0 (diff)
Merge remote-tracking branch 'upstream/develop' into feature/theming2
* upstream/develop: (60 commits) whoops whoops DM timeline: stream new statuses update-japanese-translation Add actual user search. incorporate most translation changes from MR 368 update french translation Always show dm panel. Add direct message tab. api service url remove deploy stage remove deploy stage updated and completed German translation On logout switch to public timeline. minor modification of Chinese translation update Chinese translation Add Chinese language Fix posting. Put oauth text into description. Display OAuth login on login form button. ...
Diffstat (limited to 'src/components/oauth_callback/oauth_callback.js')
-rw-r--r--src/components/oauth_callback/oauth_callback.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/components/oauth_callback/oauth_callback.js b/src/components/oauth_callback/oauth_callback.js
new file mode 100644
index 00000000..7a5132ad
--- /dev/null
+++ b/src/components/oauth_callback/oauth_callback.js
@@ -0,0 +1,20 @@
+import oauth from '../../services/new_api/oauth.js'
+
+const oac = {
+ props: ['code'],
+ mounted () {
+ if (this.code) {
+ oauth.getToken({
+ app: this.$store.state.oauth,
+ instance: this.$store.state.instance.server,
+ code: this.code
+ }).then((result) => {
+ this.$store.commit('setToken', result.access_token)
+ this.$store.dispatch('loginUser', result.access_token)
+ this.$router.push('/main/friends')
+ })
+ }
+ }
+}
+
+export default oac