Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github login redirection issue #250

Open
sonamsamdupkhangsar opened this issue Apr 21, 2022 · 1 comment
Open

Github login redirection issue #250

sonamsamdupkhangsar opened this issue Apr 21, 2022 · 1 comment

Comments

@sonamsamdupkhangsar
Copy link

I am using Github to login. I have a button in my App.vue when clicked shows the Github login and then redirects to my app and then I see a error saying "POST http://localhost:8080/auth/github 404 (Not Found)".

I am not able to get pass this currently.

The following is my sample code for the main.js. The App.vue contains a button essentially so I have left that out.

import Vue from 'vue'
//import Vuex from 'vuex'
import VueAxios from 'vue-axios'
import VueAuthenticate from 'vue-authenticate'
import axios from 'axios'
import App from './App.vue'


Vue.config.productionTip = false

//Vue.use(Vuex)
Vue.use(VueAxios, axios)
Vue.use(VueAuthenticate, {
  baseUrl: 'http://localhost:8080', // Your API domain
  
  providers: {
    github: {
      clientId: '<REDACTED>',
      redirectUri: 'http://localhost:8080/auth/callback' // Your client app URL
    }
  },
  bindRequestInterceptor: function () {
    this.$http.interceptors.request.use((config) => {
      if (this.isAuthenticated()) {
        config.headers['Authorization'] = [
          this.options.tokenType, this.getToken()
        ].join(' ')
      } else {
        delete config.headers['Authorization']
      }
      return config
    })
  },

  bindResponseInterceptor: function () {
    this.$http.interceptors.response.use((response) => {
      this.setToken(response)
      return response
    })
  }
})
new Vue({
  
  render: h => h(App),
  methods: {
    authenticate: function (provider) {
      this.$auth.authenticate(provider).then(function () {
        // Execute application logic after successful social authentication
        console.log("authenticated done")
      })
    }
  }
}).$mount('#app')
@ajmas
Copy link

ajmas commented Oct 22, 2022

Can you see if vue-authenticate-2 solves any of this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants