diff --git a/http/main.go b/http/main.go index 6d349a5..8fbcc2e 100644 --- a/http/main.go +++ b/http/main.go @@ -137,7 +137,7 @@ func handleShowVoting(ctx echo.Context) error { } if v.Deadline().After(time.Now().UTC()) { if !eligible(ctx.Request().Header.Get("X-Remote-User"), v.Electors()) { - return ctx.String(http.StatusForbidden, "") + return ctx.Render(http.StatusOK, "not_eligible", nil) } } return ctx.Render(http.StatusOK, "voting", map[string]interface{}{ diff --git a/tmpl/not_eligible.html b/tmpl/not_eligible.html new file mode 100644 index 0000000..9ef60b7 --- /dev/null +++ b/tmpl/not_eligible.html @@ -0,0 +1,19 @@ +{{ define "not_eligible" }} +{{ template "head" . }} +
+
+
+

+ Not eligible! +

+

+ Sorry, you are not eligible to vote +

+
+ +
+
+
+
+{{ template "tail" . }} +{{ end }}