diff --git a/modules/auth/login_form/main.go b/modules/auth/login_form/main.go index 14e55ab..fc44cfd 100644 --- a/modules/auth/login_form/main.go +++ b/modules/auth/login_form/main.go @@ -59,7 +59,7 @@ func (m *Module) Init(mm *modweb.ModuleManager) { user.Save(session) } - return ctx.Redirect("/") + return mm.Render(ctx, "partials/login-form", fiber.Map{"error": "Invalid username or password"}) }) } diff --git a/templates/partials/login-form.html b/templates/partials/login-form.html index 0e4f8f2..83e8a8c 100644 --- a/templates/partials/login-form.html +++ b/templates/partials/login-form.html @@ -1,14 +1,19 @@ +{{ if .error -}} +
+
{{ .error }}
+
+{{- end }}
- +
- +
- +