From 869f50db2fbc24826762fb61d35e5f8de79296c1 Mon Sep 17 00:00:00 2001 From: Gabriel Arakaki Giovanini Date: Fri, 25 Aug 2023 22:35:47 +0200 Subject: feat: Handle login error --- templates/login.qtpl | 18 +++++++++++++++--- templates/register.qtpl | 4 ++-- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'templates') diff --git a/templates/login.qtpl b/templates/login.qtpl index 56394d0..c68fb5f 100644 --- a/templates/login.qtpl +++ b/templates/login.qtpl @@ -1,5 +1,8 @@ {% code -type LoginPage struct {} +type LoginPage struct { + Username string + Err string + } %} {% func (p *LoginPage) Title() %}Login{% endfunc %} @@ -9,7 +12,7 @@ type LoginPage struct {}
- +
@@ -18,9 +21,18 @@ type LoginPage struct {}
+
+ +
+ {% if p.Err != "" %}
- +
+
+ {%s p.Err %} +
+
+ {% endif %} {% endfunc %} diff --git a/templates/register.qtpl b/templates/register.qtpl index 115edfe..4d3c545 100644 --- a/templates/register.qtpl +++ b/templates/register.qtpl @@ -25,8 +25,8 @@ type RegisterPage struct {} -
- +
+
{% endfunc %} -- cgit v1.2.3