Functional login and logout, login system should be fucntionally implemented.
Testing and polishing are next.
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user