Added invite_id field to email invite url, along with validation of this field on the server (#8235)

Этот коммит содержится в:
Jonathan
2018-02-12 09:16:17 -05:00
коммит произвёл GitHub
родитель c1b6e8792c
Коммит 9707ac3aaf
5 изменённых файлов: 79 добавлений и 13 удалений

Просмотреть файл

@@ -234,6 +234,11 @@ func (a *App) AddUserToTeamByHash(userId string, hash string, data string) (*mod
team = result.Data.(*model.Team)
}
// verify that the team's invite id hasn't been changed since the invite was sent
if team.InviteId != props["invite_id"] {
return nil, model.NewAppError("JoinUserToTeamByHash", "api.user.create_user.signup_link_mismatched_invite_id.app_error", nil, "", http.StatusBadRequest)
}
var user *model.User
if result := <-uchan; result.Err != nil {
return nil, result.Err