add LockedLogins to settings.

This commit is contained in:
Miroslav Šedivý 2024-04-20 14:27:15 +02:00
parent a178bede87
commit a61eade929
5 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,8 @@ func (api *ApiManagerCtx) Login(w http.ResponseWriter, r *http.Request) error {
return utils.HttpUnprocessableEntity("session already connected")
} else if errors.Is(err, types.ErrMemberDoesNotExist) || errors.Is(err, types.ErrMemberInvalidPassword) {
return utils.HttpUnauthorized().WithInternalErr(err)
} else if errors.Is(err, types.ErrSessionLoginsLocked) {
return utils.HttpForbidden("logins are locked").WithInternalErr(err)
} else {
return utils.HttpInternalServerError().WithInternalErr(err)
}