export const actions = {
async signIn(ctx, credentials) {
await this.$auth.loginWith("local", {
data: credentials
});
},
async signUp(ctx, user) {
return await this.$axios.$post("auth/sign-up", user);
}
};
this.$store.dispatch("signUp", this.user).then(res => {
if (res.errors) {
this.errors = res.errors;
} else {
this.$store.dispatch("signIn", {
email: this.user.email,
password: this.user.password
});
}
this.loading = false;
});