Skip to content

Instantly share code, notes, and snippets.

@Serhansolo
Created April 14, 2020 12:00
Show Gist options
  • Save Serhansolo/05c981328015c58245fc6d217bc83f46 to your computer and use it in GitHub Desktop.
Save Serhansolo/05c981328015c58245fc6d217bc83f46 to your computer and use it in GitHub Desktop.
import firebase from "firebase/app";
const actions = {
signUpAction({ commit }, payload) {
firebase
.auth()
.createUserWithEmailAndPassword(payload.email, payload.password)
.then(response => {
commit("setUser", response.user);
})
.catch(error => {
commit("setError", error.message);
});
},
signInAction({ commit }, payload) {
firebase
.auth()
.signInWithEmailAndPassword(payload.email, payload.password)
.then(response => {
commit("setUser", response.user);
})
.catch(error => {
commit("setError", error.message);
});
}
};
export default actions;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment