Skip to content

MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | fix log in - #1

Open
marissamolejon wants to merge 1 commit into
mainfrom
fix/log-in
Open

MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | fix log in#1
marissamolejon wants to merge 1 commit into
mainfrom
fix/log-in

Conversation

@marissamolejon

Copy link
Copy Markdown
Owner

Summary

logging in from a user's profile page returned a 501 error
instead of authenticating the user.

Fix

Attach handleLogin to the form's submit event using the
[data-form='login'] selector — the same pattern already used
correctly in front-end/views/login.mjs:

const loginForm = document.querySelector("[data-form='login']");
loginForm?.addEventListener("submit", handleLogin);

This is a one-line-equivalent, minimal-diff fix scoped entirely to the
file with the bug.

Testing

Manually verified locally (backend, Postgres, and static front-end
server all running):

  • ✅ Repro'd the original bug: login from profile page → 501, confirmed
    via Network tab showing a POST request of type document (native
    form submit) hitting the front-end server, not the API.
  • ✅ Applied fix, confirmed via Network tab the login request now shows
    as fetch type, hits http://localhost:3000/login, returns 200.
  • ✅ Regression check: login from the homepage still works correctly.
  • ✅ Logout from profile page still works correctly.
  • ✅ Edge case: incorrect password from the profile page now shows the
    proper error dialog ("Incorrect password") instead of a 501, since
    event.preventDefault() now runs as expected.

Scope

Single file changed: front-end/views/profile.mjs. No backend,
dependency, or unrelated front-end changes included.

@marissamolejon marissamolejon changed the title MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | fix log in on profile page MARISSA MOLEJON | OCT2025-1 | Module-Legacy-Code | Sprint 1 | fix log in Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant