diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-11-13 18:42:07 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-11-13 18:42:07 +0000 |
| commit | 11f8a4f312675a82d5fed9c5e75fed63a8456ffc (patch) | |
| tree | 18c0c0d6d966ca23f4644638974613d75ba1c8fe /src/components/oauth_callback/oauth_callback.js | |
| parent | e9b68b8c972e25df852543e9aa6670088bee06bb (diff) | |
| parent | 9f64c96721028b2749f17cbf7bd910382ce58154 (diff) | |
Merge branch 'oauth' into 'develop'
Move login to oauth.
See merge request pleroma/pleroma-fe!367
Diffstat (limited to 'src/components/oauth_callback/oauth_callback.js')
| -rw-r--r-- | src/components/oauth_callback/oauth_callback.js | 20 |
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 |
