1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Revert "Prevent a user with a different email from accepting the team invite" (#24531)

Reverts go-gitea/gitea#24491
This commit is contained in:
Lunny Xiao
2023-05-05 15:59:12 +08:00
committed by GitHub
parent 421840486f
commit 3ee7f27341
3 changed files with 11 additions and 26 deletions

View File

@@ -552,7 +552,6 @@ func TeamInvite(ctx *context.Context) {
ctx.Data["Organization"] = org
ctx.Data["Team"] = team
ctx.Data["Inviter"] = inviter
ctx.Data["EmailMismatch"] = ctx.Doer.Email != invite.Email
ctx.HTML(http.StatusOK, tplTeamInvite)
}
@@ -569,13 +568,6 @@ func TeamInvitePost(ctx *context.Context) {
return
}
// check that the Doer is the invitee
if ctx.Doer.Email != invite.Email {
log.Info("invite %d does not apply to the current user %d", invite.ID, ctx.Doer.ID)
ctx.NotFound("ErrTeamInviteNotFound", err)
return
}
if err := models.AddTeamMember(team, ctx.Doer.ID); err != nil {
ctx.ServerError("AddTeamMember", err)
return