From df65e181eb89455336ed2d7058d7234eeea9e90e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 5 Nov 2025 12:22:42 +0000 Subject: [PATCH 1/2] This is the solution for the login error --- front-end/views/profile.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/front-end/views/profile.mjs b/front-end/views/profile.mjs index dd2b92a..529cb47 100644 --- a/front-end/views/profile.mjs +++ b/front-end/views/profile.mjs @@ -38,9 +38,10 @@ function profileView(username) { "login-template", createLogin ); + document - .querySelector("[data-action='login']") - ?.addEventListener("click", handleLogin); + .querySelector("[data-form='login']") + ?.addEventListener("submit", handleLogin); const profileData = state.profiles.find((p) => p.username === username); if (profileData) { From 23890265002252b938df4ec3136f44b269cc3843 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 5 Nov 2025 12:56:12 +0000 Subject: [PATCH 2/2] Add a line to ensure that the user is redirected to the homepage after the log out --- front-end/lib/api.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/front-end/lib/api.mjs b/front-end/lib/api.mjs index f4b5339..e02fdee 100644 --- a/front-end/lib/api.mjs +++ b/front-end/lib/api.mjs @@ -138,6 +138,7 @@ async function signup(username, password) { function logout() { state.destroyState(); + window.location.hash = "/"; return {success: true}; }