pleroma-fe/src/components/oauth_callback/oauth_callback.js

21 lines
497 B
JavaScript
Raw Normal View History

2018-10-26 15:16:23 +02:00
import oauth from '../../services/new_api/oauth.js'
const oac = {
props: ['code'],
mounted () {
if (this.code) {
oauth.getToken({
...this.$store.state.oauth,
2018-10-26 15:16:23 +02:00
instance: this.$store.state.instance.server,
code: this.code
}).then((result) => {
2018-10-26 15:20:39 +02:00
this.$store.commit('setToken', result.access_token)
this.$store.dispatch('loginUser', result.access_token)
this.$router.push({ name: 'friends' })
2018-10-26 15:16:23 +02:00
})
}
}
}
export default oac