diff --git a/api/s5/http.go b/api/s5/http.go index ef3d685..c377a46 100644 --- a/api/s5/http.go +++ b/api/s5/http.go @@ -352,6 +352,13 @@ func (h *HttpHandler) AccountRegister(jc jape.Context) { return } + result = h.portal.Database().Delete(&challenge) + + if result.Error != nil { + errored(errAccountRegisterErr) + return + } + setAuthCookie(jwt, jc) } @@ -482,6 +489,13 @@ func (h *HttpHandler) AccountLogin(jc jape.Context) { return } + result = h.portal.Database().Delete(&challenge) + + if result.Error != nil { + errored(errAccountLoginErr) + return + } + setAuthCookie(jwt, jc) }