mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
feat: improve error message in GetFailedSigninConfigByUser()
This commit is contained in:
parent
45e25acc80
commit
b4e51b4631
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user