fix: need to pass the pubkey without the prefix and encoded to hex

This commit is contained in:
Derrick Hammer 2024-01-16 15:30:00 -05:00
parent accffade40
commit bc5957f881
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 4 additions and 2 deletions

View File

@ -338,13 +338,15 @@ func (h *HttpHandler) AccountRegister(jc jape.Context) {
return return
} }
err = h.portal.Accounts().AddPubkeyToAccount(*newAccount, request.Pubkey) rawPubkey := hex.EncodeToString(decodedKey[1:])
err = h.portal.Accounts().AddPubkeyToAccount(*newAccount, rawPubkey)
if err != nil { if err != nil {
errored(errAccountRegisterErr) errored(errAccountRegisterErr)
return return
} }
jwt, err := h.portal.Accounts().LoginPubkey(request.Pubkey) jwt, err := h.portal.Accounts().LoginPubkey(rawPubkey)
if err != nil { if err != nil {
errored(errAccountRegisterErr) errored(errAccountRegisterErr)
return return