Rechtsseiten oeffentlich erreichbar: Hash-Routing ohne Login + Pfad-Redirects
- app.js init(): Hash-Route wird auch ohne Login angesteuert — vorher wurden anonyme Besucher IMMER auf 'welcome' geworfen, #agb/#datenschutz/#impressum liefen damit ins Leere (DSGVO-Problem, broken Links aus iOS-App + SEO-Footer). Auth-pflichtige Seiten schuetzt weiterhin der requiresAuth-Guard in navigate(). - main.py: /agb, /datenschutz, /impressum -> 302 auf die SPA-Hash-Routen (vor dem SPA-Fallback registriert) - make bump: v1221
This commit is contained in:
parent
939e48b0c7
commit
695908f937
6 changed files with 33 additions and 17 deletions
|
|
@ -2601,6 +2601,18 @@ async def wurfboerse_page():
|
|||
return HTMLResponse(content=html, headers={"Cache-Control": "max-age=1800"})
|
||||
|
||||
|
||||
# Rechtsseiten: Pfad-URLs (SEO-Footer, App-Store-Metadaten, E-Mails) auf die
|
||||
# SPA-Hash-Routen umleiten — die Inhalte leben als SPA-Seiten (#agb, …).
|
||||
# Muss VOR dem SPA-Fallback registriert sein.
|
||||
@app.get("/agb")
|
||||
@app.get("/datenschutz")
|
||||
@app.get("/impressum")
|
||||
async def legal_page_redirect(request: _Request):
|
||||
from fastapi.responses import RedirectResponse
|
||||
page = request.url.path.strip("/")
|
||||
return RedirectResponse(f"/#{page}", status_code=302)
|
||||
|
||||
|
||||
# SPA Fallback — ALLE nicht-API-Routen gehen zur index.html
|
||||
@app.get("/{full_path:path}")
|
||||
async def spa_fallback(full_path: str):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue