changeset 545:9d999d29c642

fix: Console.log statement removed Console.log statement removed. Improved readability.
author Thomas Junk <thomas.junk@intevation.de>
date Fri, 31 Aug 2018 11:03:22 +0200
parents 9b2218a6c6ae
children b91791664554
files client/src/views/Login.vue
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/views/Login.vue	Fri Aug 31 10:56:10 2018 +0200
+++ b/client/src/views/Login.vue	Fri Aug 31 11:03:22 2018 +0200
@@ -91,6 +91,7 @@
 <script>
 import { mapGetters } from "vuex";
 import { HTTP } from "../lib/http";
+import { displayError } from "../lib/errors.js";
 
 export default {
   name: "login",
@@ -168,10 +169,9 @@
         });
     },
     showPassword() {
-      // disable button when in reset mode
-      if (!this.showPasswordReset) {
-        this.readablePassword = !this.readablePassword;
-      }
+      // disallowing toggle when in reset mode
+      if (this.showPasswordReset) return;
+      this.readablePassword = !this.readablePassword;
     },
     togglePasswordReset() {
       this.passwordJustResetted = false;
@@ -181,7 +181,11 @@
     resetPassword() {
       if (this.user) {
         HTTP.post("/users/passwordreset", { user: this.user }).catch(error => {
-          console.log("backend problem", error);
+          const { status, data } = error.response;
+          displayError({
+            title: "Backend Error",
+            message: `${status}: ${data.message}`
+          });
         });
         this.togglePasswordReset();
         this.passwordJustResetted = true;