mirror of
https://github.com/go-gitea/gitea
synced 2024-11-16 15:01:07 +01:00
Ensure only own addresses are updated (#10397)
This commit is contained in:
parent
ac18c3f6f2
commit
cfcd8e4146
2 changed files with 2 additions and 2 deletions
|
@ -1025,7 +1025,7 @@ func VerifyActiveEmailCode(code, email string) *EmailAddress {
|
|||
data := com.ToStr(user.ID) + email + user.LowerName + user.Passwd + user.Rands
|
||||
|
||||
if base.VerifyTimeLimitCode(data, minutes, prefix) {
|
||||
emailAddress := &EmailAddress{Email: email}
|
||||
emailAddress := &EmailAddress{UID: user.ID, Email: email}
|
||||
if has, _ := x.Get(emailAddress); has {
|
||||
return emailAddress
|
||||
}
|
||||
|
|
|
@ -201,7 +201,7 @@ func MakeEmailPrimary(email *EmailAddress) error {
|
|||
}
|
||||
|
||||
// Make sure the former primary email doesn't disappear.
|
||||
formerPrimaryEmail := &EmailAddress{Email: user.Email}
|
||||
formerPrimaryEmail := &EmailAddress{UID: user.ID, Email: user.Email}
|
||||
has, err = x.Get(formerPrimaryEmail)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue