🩹 Better response when not eligible to vote

This commit is contained in:
Brian Wiborg 2024-05-13 14:00:05 +02:00
parent 8f3a5b35c8
commit ff83e9abce
No known key found for this signature in database
GPG key ID: BE53FA9286B719D6
2 changed files with 20 additions and 1 deletions

View file

@ -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{}{