* fix(lib): show error message detail when hitting some common flows Instead of giving the user nothing to go off of, this patch gives them an opaque blob of ROT-13 encoded base64. The logic is that if you are smart enough to figure out how to decode this, you're probably smart enough to either fix your broken client or give it to the adminstrator. Signed-off-by: Xe Iaso <me@xeiaso.net> * docs: update CHANGELOG Signed-off-by: Xe Iaso <me@xeiaso.net> * Update metadata check-spelling run (pull_request) for Xe/show-error-state Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com> on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev> --------- Signed-off-by: Xe Iaso <me@xeiaso.net> Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
31 lines
1.1 KiB
Go
31 lines
1.1 KiB
Go
package web
|
|
|
|
import (
|
|
"github.com/a-h/templ"
|
|
|
|
"github.com/TecharoHQ/anubis/lib/challenge"
|
|
"github.com/TecharoHQ/anubis/lib/localization"
|
|
"github.com/TecharoHQ/anubis/lib/policy/config"
|
|
)
|
|
|
|
func Base(title string, body templ.Component, impressum *config.Impressum, localizer *localization.SimpleLocalizer) templ.Component {
|
|
return base(title, body, impressum, nil, nil, localizer)
|
|
}
|
|
|
|
func BaseWithChallengeAndOGTags(title string, body templ.Component, impressum *config.Impressum, challenge *challenge.Challenge, rules *config.ChallengeRules, ogTags map[string]string, localizer *localization.SimpleLocalizer) templ.Component {
|
|
return base(title, body, impressum, struct {
|
|
Rules *config.ChallengeRules `json:"rules"`
|
|
Challenge any `json:"challenge"`
|
|
}{
|
|
Challenge: challenge,
|
|
Rules: rules,
|
|
}, ogTags, localizer)
|
|
}
|
|
|
|
func ErrorPage(msg, mail, code string, localizer *localization.SimpleLocalizer) templ.Component {
|
|
return errorPage(msg, mail, code, localizer)
|
|
}
|
|
|
|
func Bench(localizer *localization.SimpleLocalizer) templ.Component {
|
|
return bench(localizer)
|
|
}
|