1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Refactor HTTP Client and LocalizedError packages

This commit is contained in:
Frédéric Guillot 2023-10-21 19:50:29 -07:00
parent 120aabfbce
commit 14e25ab9fe
104 changed files with 1277 additions and 10672 deletions

View file

@ -7,7 +7,7 @@ import (
"net/http"
"strings"
"miniflux.app/v2/internal/errors"
"miniflux.app/v2/internal/locale"
)
// AuthForm represents the authentication form.
@ -17,9 +17,9 @@ type AuthForm struct {
}
// Validate makes sure the form values are valid.
func (a AuthForm) Validate() error {
func (a AuthForm) Validate() *locale.LocalizedError {
if a.Username == "" || a.Password == "" {
return errors.NewLocalizedError("error.fields_mandatory")
return locale.NewLocalizedError("error.fields_mandatory")
}
return nil