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
2 changes: 2 additions & 0 deletions front-end/components/login.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ async function handleLogin(event) {
const password = formData.get("password");

await apiService.login(username, password);

window.location.hash = "/";
} catch (error) {
throw error;
} finally {
Expand Down
1 change: 1 addition & 0 deletions front-end/components/logout.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function createLogout(template, isLoggedIn) {
async function handleLogout(event) {
try {
apiService.logout();
window.location.hash = '/login';
} catch (error) {
throw error;
}
Expand Down
2 changes: 1 addition & 1 deletion front-end/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3>This Legacy Code project is coursework from Code Your Future</h3>
<!-- Login Component Template -->
<template id="login-template">
<section aria-label="Log in or sign up" class="login">
<form data-form="login" class="login__form" method="post">
<form data-form="login" class="login__form" method="post" action="/login">
<div class="login__field">
<label class="login__label is-invisible" for="username"
>Username</label
Expand Down