From bc5957f8816a257d59121b9523dd19751a03331d Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 16 Jan 2024 15:30:00 -0500 Subject: [PATCH] fix: need to pass the pubkey without the prefix and encoded to hex --- api/s5/http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/s5/http.go b/api/s5/http.go index 1c35c75..bc8c2b3 100644 --- a/api/s5/http.go +++ b/api/s5/http.go @@ -338,13 +338,15 @@ func (h *HttpHandler) AccountRegister(jc jape.Context) { return } - err = h.portal.Accounts().AddPubkeyToAccount(*newAccount, request.Pubkey) + rawPubkey := hex.EncodeToString(decodedKey[1:]) + + err = h.portal.Accounts().AddPubkeyToAccount(*newAccount, rawPubkey) if err != nil { errored(errAccountRegisterErr) return } - jwt, err := h.portal.Accounts().LoginPubkey(request.Pubkey) + jwt, err := h.portal.Accounts().LoginPubkey(rawPubkey) if err != nil { errored(errAccountRegisterErr) return