From c4d885cf6db08f273291389ec67c5163d72cbfc7 Mon Sep 17 00:00:00 2001 From: CPunch Date: Mon, 4 Dec 2023 20:30:58 -0600 Subject: [PATCH] Login && Password need to be at least 4 long --- internal/db/account.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/db/account.go b/internal/db/account.go index 011c6f7..e835a33 100644 --- a/internal/db/account.go +++ b/internal/db/account.go @@ -54,6 +54,11 @@ func (db *DBHandler) TryLogin(Login, Password string) (*Account, error) { return nil, err } + // make sure id && pw are valid + if len(Login) < 4 || len(Password) < 4 { + return nil, ErrLoginInvalidPassword + } + var account Account row.Next() if err := sqlscan.ScanRow(&account, row); err != nil {