vue-authenticate icon indicating copy to clipboard operation
vue-authenticate copied to clipboard

Can this be used without vue-axios - just axios?

Open menasheh opened this issue 7 years ago • 3 comments

I just want to use axios and don't feel the need to add bloat with wrapper classes like vue-axios. I already use axios in my vue app and don't need vue-axios. Is there a way to get vue-authenticate to use it without the wrapper class?

menasheh avatar Jul 08 '18 21:07 menasheh

Up!

Kuzzy avatar Aug 06 '18 12:08 Kuzzy

Sorry, i was a bit off from this project. Starting to resolve these issues now...

You can use only axios, but you'll have to use vue-authenticate as a service, instead as a Vue plugin. Just like here (https://github.com/dgrubelic/vue-authenticate#vuex-authentication), instead of passing Vue.prototype.$http, you should be able to pass axios object and the rest should work. Give it a try and let me know.

dgrubelic avatar Oct 09 '18 14:10 dgrubelic

@menasheh example:

const http = axios.create({})

const vueAuth = new VueAuthenticate(http, {
  baseUrl: 'SERVER API URL'
  providers: {
    google: {
      clientId: 'some-random-id',
      redirectUri: 'http://localhost:3000/auth'
    }
  }
})

pnowy avatar Nov 08 '18 06:11 pnowy