From def1b50cfcba8c68f3b95209790418638374fad9 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 6 Jun 2023 22:04:59 -0400 Subject: [PATCH] fix: ensure we store the pubkey in lowercase --- controller/account.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/account.go b/controller/account.go index 0ef885f..c167217 100644 --- a/controller/account.go +++ b/controller/account.go @@ -14,6 +14,7 @@ import ( "golang.org/x/crypto/bcrypt" "gorm.io/gorm" "reflect" + "strings" ) type AccountController struct { @@ -116,7 +117,7 @@ func (a *AccountController) PostRegister() { } if len(r.Pubkey) > 0 { - if err := tx.Create(&model.Key{Account: account, Pubkey: r.Pubkey}).Error; err != nil { + if err := tx.Create(&model.Key{Account: account, Pubkey: strings.ToLower(r.Pubkey)}).Error; err != nil { return err } }