feat: improve error message in GetFailedSigninConfigByUser()

This commit is contained in:
Yang Luo 2024-08-10 09:31:46 +08:00
parent 45e25acc80
commit b4e51b4631
3 changed files with 3 additions and 2 deletions

View File

@ -60,7 +60,6 @@ func (c *ApiController) Unlink() {
c.ResponseError(err.Error())
return
}
if application == nil {
c.ResponseError(c.T("link:You can't unlink yourself, you are not a member of any application"))
return

View File

@ -52,6 +52,9 @@ func GetFailedSigninConfigByUser(user *User) (int, int, error) {
if err != nil {
return 0, 0, err
}
if application == nil {
return 0, 0, fmt.Errorf("the application for user %s is not found", user.GetId())
}
failedSigninLimit := application.FailedSigninLimit
if failedSigninLimit == 0 {

View File

@ -277,7 +277,6 @@ func GetValidationBySaml(samlRequest string, host string) (string, string, error
if err != nil {
return "", "", err
}
if application == nil {
return "", "", fmt.Errorf("the application for user %s is not found", userId)
}