diff --git a/src/components/Login.vue b/src/components/Login.vue index 1ea77d6..7e971c4 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -61,7 +61,6 @@ }); this.$router.push({ path: '/' }); } catch (e) { - // Si el servicio devuelve un error (ej. 401) lo convertimos en excepción const msg = e?.response?.data?.message ?? e.message; this.error = msg ?? 'Error al iniciar sesión'; } diff --git a/src/components/LoginDialog.vue b/src/components/LoginDialog.vue index 24bedb4..df79108 100644 --- a/src/components/LoginDialog.vue +++ b/src/components/LoginDialog.vue @@ -56,7 +56,7 @@ export default { password: this.password, }); this.show = false; - this.$emit('login-success'); // notifica al NavBar + this.$emit('login-success'); } catch (e) { this.error = e.message ?? 'Error al iniciar sesión'; } diff --git a/src/components/Logout.vue b/src/components/Logout.vue index 50598ca..7e1098e 100644 --- a/src/components/Logout.vue +++ b/src/components/Logout.vue @@ -1,29 +1,32 @@ - + + + diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index faf893a..0f2f5ef 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -77,14 +77,14 @@ mounted() { this.checkAuth(); }, - watch: { - group () { - this.drawer = false - }, - $route() { - this.checkAuth(); - }, - }, + watch: { + group () { + this.drawer = false + }, + $route() { + this.checkAuth(); + }, + }, methods: { checkAuth() { this.isAuthenticated = AuthService.isAuthenticated(); diff --git a/src/services/auth.js b/src/services/auth.js index 3766e8e..87743b6 100644 --- a/src/services/auth.js +++ b/src/services/auth.js @@ -16,9 +16,7 @@ class AuthService { try { const errData = await resp.json(); errMsg = errData?.detail ?? errData?.message ?? errMsg; - } catch (_) { - - } + } catch (_) { /* ignore */ } throw new Error(errMsg); }