Skip to content

Github login redirection issue #250

@sonamsamdupkhangsar

Description

@sonamsamdupkhangsar

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions