mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-14 04:28:49 +00:00
fix(web): embed challenge ID into generated pages
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -92,15 +92,10 @@ func (s *Server) getTokenKeyfunc() jwt.Keyfunc {
|
||||
}
|
||||
|
||||
func (s *Server) getChallenge(r *http.Request) (*challenge.Challenge, error) {
|
||||
ckies := r.CookiesNamed(anubis.TestCookieName)
|
||||
if len(ckies) == 0 {
|
||||
return nil, store.ErrNotFound
|
||||
}
|
||||
|
||||
id := r.FormValue("id")
|
||||
j := store.JSON[challenge.Challenge]{Underlying: s.store}
|
||||
|
||||
ckie := ckies[0]
|
||||
chall, err := j.Get(r.Context(), "challenge:"+ckie.Value)
|
||||
chall, err := j.Get(r.Context(), "challenge:"+id)
|
||||
|
||||
return &chall, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user