A5: sign up, sign in, sign out, profile and the base layout (WEB-02, WEB-06, WEB-11, WEB-50..54)
Registration (case-insensitive unique names, 8-256 char passwords, no email), sign-in with a generic error and a fresh session, internal-only ?next=, POST-only sign-out, password change that closes the other sessions. The failed-login backoff, the registration quota and the password-change guard live in the database so every web process shares them; the client IP is the last X-Forwarded-For hop. One responsive stylesheet with light/dark theme, labelled fields, alerts and no inline scripts or styles; Italian error pages and a readable CSRF failure. Mutation checks: open redirects, uncounted failures and a missing CSRF middleware are all caught. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d4b53d778
commit
efb3e2e702
28 files changed
+1232
-22
No files matched your search
@@ -0,0 +1,6 @@
|
||||
{% extends "web/base.html" %}
|
||||
{% block title %}Gioca · PLM Lottery{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Area giocatore</h1>
|
||||
<p>Ciao {{ user.get_username }}. La schermata di gioco è in costruzione.</p>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,47 @@
|
||||
{% load static %}<!doctype html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="color-scheme" content="light dark">
|
||||
<title>{% block title %}PLM Lottery{% endblock %}</title>
|
||||
<link rel="stylesheet" href="{% static 'web/site.css' %}">
|
||||
</head>
|
||||
<body>
|
||||
<a class="skip-link" href="#contenuto">Vai al contenuto</a>
|
||||
<header class="site-header">
|
||||
<div class="wrap bar">
|
||||
<a class="brand" href="{% url 'web:home' %}">PLM Lottery</a>
|
||||
<nav class="nav" aria-label="Principale">
|
||||
<a href="{% url 'web:home' %}">Home</a>
|
||||
{% if user.is_authenticated %}
|
||||
<a href="{% url 'web:app-home' %}">Gioca</a>
|
||||
<a href="{% url 'accounts:profile' %}">Profilo</a>
|
||||
<form class="inline" method="post" action="{% url 'accounts:logout' %}">
|
||||
{% csrf_token %}
|
||||
<button class="link-button" type="submit">Esci ({{ user.get_username }})</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<a href="{% url 'accounts:login' %}">Accedi</a>
|
||||
<a class="button small" href="{% url 'accounts:register' %}">Registrati</a>
|
||||
{% endif %}
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="contenuto" class="wrap" tabindex="-1">
|
||||
{% if messages %}
|
||||
<div class="messages" role="status">
|
||||
{% for message in messages %}<p class="message {{ message.tags }}">{{ message }}</p>{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="wrap">
|
||||
<p>Ambiente di prova su rete regtest: nessun denaro reale.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
{% extends "web/base.html" %}
|
||||
{% block title %}{{ title }} · PLM Lottery{% endblock %}
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
<p>{{ message }}</p>
|
||||
<p><a class="button" href="/">Torna alla home</a></p>
|
||||
{% endblock %}
|
||||
@@ -1,14 +1,5 @@
|
||||
<!doctype html>
|
||||
<html lang="it">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>PLM Lottery</title>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>PLM Lottery</h1>
|
||||
<p>Il sito è in costruzione.</p>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
{% extends "web/base.html" %}
|
||||
{% block content %}
|
||||
<h1>PLM Lottery</h1>
|
||||
<p>Il sito è in costruzione.</p>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user