diadal / vue-social-auth

Laravel Vue (SPA) Social Auth
75 stars 27 forks source link

Invalid OAuth type for Twitch & Discord #33

Closed stevenhardy-digital closed 3 years ago

stevenhardy-digital commented 3 years ago

Hello,

I am implementing this extension to work with Socialite provider for Twitch and Discord, however after following your set up guide, I am receiving the below error:

Error: Invalid OAuth type
    at eval (webpack-internal:///./node_modules/vue-social-auth/dist/vue-social-auth.es2017.js:1313:23)
    at doResolve (webpack-internal:///./node_modules/vue-social-auth/dist/vue-social-auth.es2017.js:307:5)
    at new Promise$1 (webpack-internal:///./node_modules/vue-social-auth/dist/vue-social-auth.es2017.js:218:3)
    at VueSocialauth.authenticate (webpack-internal:///./node_modules/vue-social-auth/dist/vue-social-auth.es2017.js:1298:10)
    at VueComponent.AuthProvider (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/Auth/Login.vue?vue&type=script&lang=js&:89:18)
    at click (webpack-internal:///./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"407f9b7e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/views/Auth/Login.vue?vue&type=template&id=857fd648&:116:24)
    at invokeWithErrorHandling (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:1853:26)
    at HTMLButtonElement.invoker (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:2178:14)
    at HTMLButtonElement.original._wrapper (webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:6907:25)

To trigger this, I am using <button @click="AuthProvider('twitch')"></button>

This is the code I am using:

    AuthProvider(provider) {
      this.$auth.authenticate(provider).then(response =>{

        this.SocialLogin(provider,response)
      }).catch(err => {
        console.log({err:err})
      })
    },

    SocialLogin(provider,response){
      this.$http.post('/sociallogin/'+provider,response).then(response => {
        console.log(response.data)
      }).catch(err => {
        console.log({err:err})
      })
    },

Please note: this.$auth.authenticate and this.$http.post appear to not be found in my build. In PHPStorm they have an error line. Is there something that I could have missed in the process of setting up?

Are you able to suggest how I can resolve this issue please?

diadal commented 3 years ago

Already working on the new version it will be ready in couple of days before weekend twitch not available the new version will enable you to add any provide of your choice

stevenhardy-digital commented 3 years ago

This sounds brilliant, thank you so much for your time and effort to help us developers! Looking forward to seeing it. I’ll move over that bit for now and come back to it once the new package is released. Thanks again.

diadal commented 3 years ago

you can now use this https://github.com/diadal/universal-social-auth you need to add twitch as custom better still add it to provider @ https://github.com/diadal/universal-social-auth/blob/main/src/providers/index.ts submit the PR