fix: challenge needs to be base64url encoded

This commit is contained in:
Derrick Hammer 2024-01-16 15:12:05 -05:00
parent db46fcd774
commit 09216e2817
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -213,7 +213,7 @@ func (h *HttpHandler) AccountRegisterChallenge(jc jape.Context) {
result := h.portal.Database().Create(&models.S5Challenge{
Pubkey: pubkey,
Challenge: hex.EncodeToString(challenge),
Challenge: base64.RawURLEncoding.EncodeToString(challenge),
Type: "register",
})
@ -386,7 +386,7 @@ func (h *HttpHandler) AccountLoginChallenge(jc jape.Context) {
}
result := h.portal.Database().Create(&models.S5Challenge{
Challenge: hex.EncodeToString(challenge),
Challenge: base64.RawURLEncoding.EncodeToString(challenge),
Type: "login",
})