I'm following this tutorial as a way to get familiar with Vue.js, vuex, and Firebase.
I have set up a Firebase account and created a simple 'Signup' page per the linked blog post. I get the following error when trying send a create user request to Firebase.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.googleapis.com/blah/blah. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘https://localhost:8080’).
The signup form triggers the following method:
userSignUp () {
if (this.comparePasswords !== true) {
return
}
this.$store.dispatch('userSignUp', {
email: this.email,
password: this.password
})
}
Which in turn calls:
userSignUp ({ commit }, payload) {
firebase.auth().createUserWithEmailAndPassword(payload.email, payload.password)
I am using npm run dev
to host the files locally.
Do I need to add something to the request header from within Vue?