mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 03:00:18 +08:00
feat: fix resetting email and phone bug (#1579)
This commit is contained in:
@ -188,7 +188,7 @@ func (c *ApiController) ResetEmailOrPhone() {
|
||||
checkDest := dest
|
||||
organization := object.GetOrganizationByUser(user)
|
||||
if destType == "phone" {
|
||||
if object.HasUserByField(user.Owner, "phone", user.Phone) {
|
||||
if object.HasUserByField(user.Owner, "phone", dest) {
|
||||
c.ResponseError(c.T("check:Phone already exists"))
|
||||
return
|
||||
}
|
||||
@ -208,7 +208,7 @@ func (c *ApiController) ResetEmailOrPhone() {
|
||||
return
|
||||
}
|
||||
} else if destType == "email" {
|
||||
if object.HasUserByField(user.Owner, "email", user.Email) {
|
||||
if object.HasUserByField(user.Owner, "email", dest) {
|
||||
c.ResponseError(c.T("check:Email already exists"))
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user