diff --git a/client/src/app.vue b/client/src/app.vue
index dfe9b52..663f79d 100644
--- a/client/src/app.vue
+++ b/client/src/app.vue
@@ -122,4 +122,8 @@ input.edit-field:focus {
color: red;
font-weight: bold;
}
+.form-error {
+ color: red;
+ font-size: 0.9rem;
+}
diff --git a/client/src/components/login.vue b/client/src/components/login.vue
index 3ba2eb3..28897e2 100644
--- a/client/src/components/login.vue
+++ b/client/src/components/login.vue
@@ -10,6 +10,9 @@
+
+ {{ error }}
+
@@ -28,7 +31,8 @@ export default {
data: function() {
return {
email: "",
- password: ""
+ password: "",
+ error: ""
}
},
methods: {
@@ -40,7 +44,7 @@ export default {
this.$router.push({ path: '/budgets' });
}
catch (error) {
- alert(error.response.data.error)
+ this.error = error.response.data.error;
}
}
}
diff --git a/client/src/components/register.vue b/client/src/components/register.vue
index 392546b..8c3adc1 100644
--- a/client/src/components/register.vue
+++ b/client/src/components/register.vue
@@ -15,6 +15,9 @@
Passwords do not match!
+
+ {{ error }}
+
@@ -31,7 +34,8 @@ export default {
return {
email: '',
password: '',
- passwordconfirm: ''
+ passwordconfirm: '',
+ error: ''
}
},
methods: {
@@ -43,7 +47,7 @@ export default {
this.$router.push({ path: '/budgets' });
}
catch (error) {
- alert(error.response.data.error);
+ this.error = error.response.data.error;
}
}
}