Login && Password need to be at least 4 long

This commit is contained in:
CPunch 2023-12-04 20:30:58 -06:00
parent afd5c9ef23
commit c4d885cf6d

View File

@ -54,6 +54,11 @@ func (db *DBHandler) TryLogin(Login, Password string) (*Account, error) {
return nil, err return nil, err
} }
// make sure id && pw are valid
if len(Login) < 4 || len(Password) < 4 {
return nil, ErrLoginInvalidPassword
}
var account Account var account Account
row.Next() row.Next()
if err := sqlscan.ScanRow(&account, row); err != nil { if err := sqlscan.ScanRow(&account, row); err != nil {