Skip to content

Conversation

@Sana9058
Copy link

This PR adds a new login form template to the templates/html directory.

The template follows the existing project structure and provides a clean, reusable login form for the login page.

Closes #176

@Schlaumeier5 Schlaumeier5 self-requested a review January 17, 2026 14:43
Copy link
Member

Choose a reason for hiding this comment

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

At the moment, we need a little script to override the form behavior, you can look here:

<script>
document.getElementById("loginForm").addEventListener("submit", async (e) => {
e.preventDefault();
let formData = new FormData(e.target);
let response = await fetch("/login", {
method: "POST",
body: new URLSearchParams(formData),
credentials: "include"
});
if (response.ok) {
window.location.href = "/dashboard";
} else {
alert("Falsches Passwort!");
}
});
</script>

Copy link
Member

@Schlaumeier5 Schlaumeier5 left a comment

Choose a reason for hiding this comment

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

Looks nice, can you add the script from site/login.html and use the template in site/login.html and site/index.html (replace the code there with "%[login]%"
Thank you for your help!

@Sana9058
Copy link
Author

@Schlaumeier5 Thanks for the suggestion!
I’ve moved the login script into the login template and updated site/login.html and site/index.html to use %{login}% as requested.

@Schlaumeier5 Schlaumeier5 self-requested a review January 18, 2026 01:34
Copy link
Member

@Schlaumeier5 Schlaumeier5 left a comment

Choose a reason for hiding this comment

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

Looks nice, tyvm :)

@Schlaumeier5 Schlaumeier5 merged commit 49fce0d into Learn-Monitor:main Jan 18, 2026
5 of 6 checks passed
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.

Add a login form template

2 participants