feat(landing): pagina comerciala la / pentru vizitatori neautentificati
Importa design-ul "Gateway RAR AUTOPASS Landing" din claude.ai/design si il implementeaza ca pagina responsiva single-page (app/web/templates/landing.html): hero + mockup dashboard, problema, calculator interactiv, avertisment legal (L.142/2023, OMTI 210/2024), pasi, integrare API, preturi (4 planuri), formular inregistrare/autentificare cu tab-uri, CTA final, footer. 4 teme comutabile (Grafit/Cobalt/Cupru/Hartie) persistate in localStorage, fonturi self-hostate, logo /static/romfast_logo.png (fara CDN extern). "/" serveste landing-ul pentru vizitatorul neautentificat (except LoginRequired) si dashboard-ul pentru cel logat; formularele posteaza real la /signup si /login cu token CSRF. Rutele protejate raman redirect /login. test_dashboard_scope: anonim pe / -> landing 200 (nu redirect); ruta protejata ramane 303 /login. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,8 +93,13 @@ def test_submissions_fragment_scoped(env, monkeypatch):
|
||||
assert f'id="trimitere-row-{sub_a}"' not in r.text
|
||||
|
||||
|
||||
def test_nelogat_redirect(monkeypatch):
|
||||
"""web_auth_required=True + fara sesiune -> 303 redirect /login."""
|
||||
def test_nelogat_landing(monkeypatch):
|
||||
"""web_auth_required=True + fara sesiune -> landing comercial (200) la /.
|
||||
|
||||
"/" e suprafata publica: vizitatorul vede landing-ul cu formularele de
|
||||
inregistrare/autentificare (post la /signup, /login). Rutele protejate
|
||||
(fragmente, POST-uri) raman redirect /login.
|
||||
"""
|
||||
tmp = tempfile.mkdtemp()
|
||||
monkeypatch.setenv("AUTOPASS_DB_PATH", os.path.join(tmp, "t_auth.db"))
|
||||
monkeypatch.setenv("AUTOPASS_WEB_AUTH_REQUIRED", "true")
|
||||
@@ -103,8 +108,13 @@ def test_nelogat_redirect(monkeypatch):
|
||||
from app.main import app
|
||||
with TestClient(app, follow_redirects=False) as c:
|
||||
r = c.get("/")
|
||||
assert r.status_code == 303
|
||||
assert "/login" in r.headers.get("location", "")
|
||||
assert r.status_code == 200
|
||||
assert 'action="/signup"' in r.text
|
||||
assert 'action="/login"' in r.text
|
||||
# ruta protejata fara sesiune -> tot redirect /login
|
||||
r2 = c.get("/_fragments/submissions")
|
||||
assert r2.status_code == 303
|
||||
assert "/login" in r2.headers.get("location", "")
|
||||
get_settings.cache_clear()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user