Functional login and logout, login system should be fucntionally implemented.

Testing and polishing are next.
This commit is contained in:
2026-03-08 22:24:13 +01:00
parent cf4a611231
commit 986629f0a5
13 changed files with 84 additions and 14 deletions
+51
View File
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
</head>
<body>
<nav>
<a href="{{ url_for('main.dashboard') }}">Dashboard</a>
<a href="{{ url_for('login.logout') }}">Logout</a>
</nav>
<div class="container">
```
<h1>Dashboard</h1>
<p>Welcome back <strong>{{ current_user.username }}</strong> 👋</p>
<div class="user-info">
<h3>Your Account</h3>
<p><strong>User ID:</strong> {{ current_user.id }}</p>
<p><strong>Username:</strong> {{ current_user.username }}</p>
{% if current_user.email %}
<p><strong>Email:</strong> {{ current_user.email }}</p>
{% else %}
<p><strong>Email:</strong> Not set</p>
{% endif %}
<p><strong>Account created:</strong> {{ current_user.created_at }}</p>
</div>
<div class="logout">
<form action="{{ url_for('login.logout') }}" method="post">
<button type="submit">Logout</button>
</form>
</div>
```
</div>
</body>
</html>
+1 -1
View File
@@ -27,7 +27,7 @@
<a href="/dashboard">Dashboard</a>
<a href="/logout">Logout</a>
{% else %}
<a href="/login">Login</a>
<a href="{{ url_for('login.login') }}">Login</a>
{% endif %}
</nav>
</div>
+3 -3
View File
@@ -19,8 +19,8 @@
<body>
<nav>
<ul>
<li><a href="/login">Login</a></li>
<li><a href="/register">Create account</a></li>
<li><a href="{{ url_for('login.login') }}">Login</a></li>
<li><a href="{{ url_for('login.register') }}">Create account</a></li>
</ul>
</nav>
<h1>Login to your account</h1>
@@ -29,7 +29,7 @@
<p class="error">{{ error }}</p>
{% endif %}
<form action="/login" method="post">
<form action="{{ url_for('login.login') }}" method="post">
<label for="username">Username:</label>
<input type="text" name="username" required />
<label for="password">Password:</label>
+3 -3
View File
@@ -19,8 +19,8 @@
<body>
<nav>
<ul>
<li><a href="/login">Login</a></li>
<li><a href="/register">Create account</a></li>
<li><a href="{{ url_for('login.login') }}">Login</a></li>
<li><a href="{{ url_for('login.register') }}">Create account</a></li>
</ul>
</nav>
<h1>Create an account</h1>
@@ -29,7 +29,7 @@
<p class="error">{{ error }}</p>
{% endif %}
<form action="/register" method="post">
<form action="{{ url_for('login.register') }}" method="post">
<label for="username">Username:</label>
<input type="text" name="username" required />
<label for="password">Password:</label>