mirror of
https://github.com/TecharoHQ/anubis.git
synced 2025-08-03 17:59:24 -04:00

* fix(lib): fix race condition when rendering multiple challenge pages at once Closes #832 Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(web): make try again button work Looks like the intent of this was "try the solution again". This fix makes the client try the challenge again. Signed-off-by: Xe Iaso <me@xeiaso.net> * fix(web): don't block a user if they have an invalid challenge cookie Signed-off-by: Xe Iaso <me@xeiaso.net> * docs: update CHANGELOG Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package web
|
|
|
|
import (
|
|
"github.com/a-h/templ"
|
|
|
|
"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 string, rules *config.ChallengeRules, ogTags map[string]string, localizer *localization.SimpleLocalizer) (templ.Component, error) {
|
|
return base(title, body, impressum, struct {
|
|
Rules *config.ChallengeRules `json:"rules"`
|
|
Challenge string `json:"challenge"`
|
|
}{
|
|
Challenge: challenge,
|
|
Rules: rules,
|
|
}, ogTags, localizer), nil
|
|
}
|
|
|
|
func Index(localizer *localization.SimpleLocalizer) templ.Component {
|
|
return index(localizer)
|
|
}
|
|
|
|
func ErrorPage(msg, mail, redirect string, localizer *localization.SimpleLocalizer) templ.Component {
|
|
return errorPage(msg, mail, redirect, localizer)
|
|
}
|
|
|
|
func Bench(localizer *localization.SimpleLocalizer) templ.Component {
|
|
return bench(localizer)
|
|
}
|