From d5659d7091e9b3cb4c7c497912a2ef3e0164b3e0 Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Wed, 8 Apr 2026 07:11:03 +0200 Subject: [PATCH] fix: login page uses login_buttons format expected by template --- app/web/router.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/web/router.py b/app/web/router.py index a51f19f..eea5fdc 100644 --- a/app/web/router.py +++ b/app/web/router.py @@ -165,7 +165,18 @@ async def login_page(request: Request): providers.append({"name": "email", "display_name": "Email Link", "icon": "mail"}) except Exception: pass - ctx = _build_context(request, providers=providers) + + # Convert to login_buttons format expected by template + login_buttons = [] + for p in providers: + if p["name"] == "google": + login_buttons.append({"url": "/auth/google/login", "text": "Sign in with Google", "css_class": "btn-primary", "icon_html": ""}) + elif p["name"] == "password": + login_buttons.append({"url": "/login/password", "text": "Sign in with Email & Password", "css_class": "btn-secondary", "icon_html": ""}) + elif p["name"] == "email": + login_buttons.append({"url": "/login/email", "text": "Sign in with Email Link", "css_class": "btn-secondary", "icon_html": ""}) + + ctx = _build_context(request, providers=providers, login_buttons=login_buttons) return templates.TemplateResponse(request, "login.html", ctx)