fix: if email is empty set to a dummy address based on the pubkey

This commit is contained in:
Derrick Hammer 2024-01-16 16:16:37 -05:00
parent dd66f560ef
commit 1054c52e2f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 5 additions and 0 deletions

View File

@ -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 {