From 1054c52e2fb2b4937f735590af1c9b4bb778dfc2 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 16 Jan 2024 16:16:37 -0500 Subject: [PATCH] fix: if email is empty set to a dummy address based on the pubkey --- api/s5/http.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/s5/http.go b/api/s5/http.go index 4f02fe9..1f76856 100644 --- a/api/s5/http.go +++ b/api/s5/http.go @@ -7,6 +7,7 @@ import ( "encoding/base64" "encoding/hex" "errors" + "fmt" "git.lumeweb.com/LumeWeb/libs5-go/encoding" "git.lumeweb.com/LumeWeb/libs5-go/types" "git.lumeweb.com/LumeWeb/portal/db/models" @@ -303,6 +304,10 @@ func (h *HttpHandler) AccountRegister(jc jape.Context) { return } + if request.Email == "" { + request.Email = fmt.Sprintf("%s@%s", hex.EncodeToString(decodedKey[1:]), "example.com") + } + verify, _ := h.verifier.Verify(request.Email) if !verify.Syntax.Valid {