Skip to content

Commit

Permalink
fix: fix CheckUserPassword()'s response handling, using wrong passwor…
Browse files Browse the repository at this point in the history
…d caused nil pointer dereference (#92)
  • Loading branch information
JK-97 authored Nov 24, 2023
1 parent 1d117c4 commit fce8275
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions casdoorsdk/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ func (c *Client) DeleteUser(user *User) (bool, error) {
}

func (c *Client) CheckUserPassword(user *User) (bool, error) {
response, _, err := c.modifyUser("check-user-password", user, nil)
return response.Status == "ok", err
_, affected, err := c.modifyUser("check-user-password", user, nil)
return affected, err
}

func (u User) GetId() string {
Expand Down

0 comments on commit fce8275

Please sign in to comment.