fix: ensure we store the pubkey in lowercase

This commit is contained in:
Derrick Hammer 2023-06-06 22:04:59 -04:00
parent f3172b0d31
commit def1b50cfc
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import (
"golang.org/x/crypto/bcrypt" "golang.org/x/crypto/bcrypt"
"gorm.io/gorm" "gorm.io/gorm"
"reflect" "reflect"
"strings"
) )
type AccountController struct { type AccountController struct {
@ -116,7 +117,7 @@ func (a *AccountController) PostRegister() {
} }
if len(r.Pubkey) > 0 { 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 return err
} }
} }