-
Notifications
You must be signed in to change notification settings - Fork 240
Open
Description
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')
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels