mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-15 04:58:43 +00:00
fix(web): embed challenge ID into generated pages
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -3,6 +3,7 @@ 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"
|
||||
)
|
||||
@@ -11,14 +12,14 @@ func Base(title string, body templ.Component, impressum *config.Impressum, local
|
||||
return base(title, body, impressum, nil, nil, localizer)
|
||||
}
|
||||
|
||||
func BaseWithChallengeAndOGTags(title string, body templ.Component, impressum *config.Impressum, challenge string, rules *config.ChallengeRules, ogTags map[string]string, localizer *localization.SimpleLocalizer) (templ.Component, error) {
|
||||
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 string `json:"challenge"`
|
||||
Challenge any `json:"challenge"`
|
||||
}{
|
||||
Challenge: challenge,
|
||||
Rules: rules,
|
||||
}, ogTags, localizer), nil
|
||||
}, ogTags, localizer)
|
||||
}
|
||||
|
||||
func ErrorPage(msg, mail string, localizer *localization.SimpleLocalizer) templ.Component {
|
||||
|
||||
Reference in New Issue
Block a user