<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login</title>
</head>
<body>
    <h1>Login</h1>
    <form action="/login" method="POST">
        <input type="hidden" name="_csrf" value="<%= csrfToken %>">
        <label for="username">Username</label>
        <input type="text" id="username" name="username" required>
        <label for="password">Password</label>
        <input type="password" id="password" name="password" required>
        <!-- Display message if password is incorrect -->
        <% if (typeof errorMessage !== 'undefined' && errorMessage !== null) { %>
            <p style="color: red;"><%= errorMessage %></p>
        <% } %>
        <!-- Add button for registration -->
        <a href="/register">Register</a>
        <button type="submit">Login</button>
    </form>
</body>
</html>
