yandere_fe/src/components/oauth_callback/oauth_callback.js

21 lines
495 B
JavaScript
Raw Normal View History

2018-10-26 06:16:23 -07:00
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) => {
2018-10-26 06:20:39 -07:00
this.$store.commit('setToken', result.access_token)
this.$store.dispatch('loginUser', result.access_token)
2018-10-26 06:16:23 -07:00
this.$router.push('/main/friends')
})
}
}
}
export default oac