Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions front-end/lib/api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ async function signup(username, password) {

function logout() {
state.destroyState();
window.location.hash = "/";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this part of the change - if the profile page works when logged out, why do we want to take someone away from it when they log out? (I can argue this either way - I'm interested in your thoughts here)

return {success: true};
}

Expand Down
5 changes: 3 additions & 2 deletions front-end/views/profile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down