mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
Improve user error handling.
This commit is contained in:
@ -179,7 +179,7 @@ func GetOAuthCode(userId string, clientId string, responseType string, redirectU
|
||||
user := GetUser(userId)
|
||||
if user == nil {
|
||||
return &Code{
|
||||
Message: "Invalid user_id",
|
||||
Message: fmt.Sprintf("The user: %s doesn't exist", userId),
|
||||
Code: "",
|
||||
}
|
||||
}
|
||||
|
@ -313,6 +313,10 @@ func AddUser(user *User) bool {
|
||||
user.Id = util.GenerateId()
|
||||
}
|
||||
|
||||
if user.Owner == "" || user.Name == "" {
|
||||
return false
|
||||
}
|
||||
|
||||
organization := GetOrganizationByUser(user)
|
||||
user.UpdateUserPassword(organization)
|
||||
|
||||
|
Reference in New Issue
Block a user