logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git

oauth_callback.js (567B)


  1. import oauth from '../../services/new_api/oauth.js'
  2. const oac = {
  3. props: ['code'],
  4. mounted () {
  5. if (this.code) {
  6. const { clientId, clientSecret } = this.$store.state.oauth
  7. oauth.getToken({
  8. clientId,
  9. clientSecret,
  10. instance: this.$store.state.instance.server,
  11. code: this.code
  12. }).then((result) => {
  13. this.$store.commit('setToken', result.access_token)
  14. this.$store.dispatch('loginUser', result.access_token)
  15. this.$router.push({ name: 'friends' })
  16. })
  17. }
  18. }
  19. }
  20. export default oac