v2.1 — Session-Passcode System für Multi-Device

Features:
- 6-stelliger Passcode pro Session (z.B. 5E92C5)
- /join Seite: Passcode-Eingabe für andere Geräte
- /api/session/join: Verifiziert Passcode, setzt Cookie
- /api/session/info: Gibt Session-ID + Passcode zurück
- Index-Seite zeigt Passcode mit Hinweis
- Chat-Header zeigt Passcode (lila hervorgehoben)
- Passcode in sessions Tabelle gespeichert
- Falscher Code = Fehlermeldung, kein Raten möglich

Workflow:
1. Desktop: Öffne NeonChat → siehst Passcode im Header
2. Handy: Öffne http://[IP]:5252/join → Code eingeben
3. Handy bekommt gleiches Cookie → gleicher Chat-Verlauf
This commit is contained in:
arch_agent
2026-07-24 21:47:30 +02:00
parent a432226824
commit c60d1219b2
4 changed files with 147 additions and 41 deletions
+6
View File
@@ -42,6 +42,12 @@
<div class="container">
<h1>✦ NeonChat</h1>
<p class="subtitle">Lokaler RP-Chatbot · Wähle einen Charakter oder erstelle einen neuen</p>
{% if passcode %}
<p style="color: var(--accent); font-size: 0.85rem; margin-bottom: 20px; padding: 8px 14px; background: #15151f; border: 1px solid var(--accent); border-radius: 8px; display: inline-block;">
🔑 Session-Passcode: <b style="font-family: monospace; letter-spacing: 4px;">{{ passcode }}</b>
<br><span style="color: #6b6b80; font-size: 0.8rem;">Auf anderem Gerät: <a href="/join" style="color: var(--accent);">/join</a> öffnen und Code eingeben</span>
</p>
{% endif %}
<div class="char-grid">
{% for c in characters %}
<div class="char-card" onclick="location.href='/chat/{{ c.filename | urlencode }}'">