Fixed error information being obscured when joining teams with API v4 (#6751)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
4484c82b1b
Коммит
c66799a839
@@ -199,12 +199,12 @@ func AddUserToTeamByHash(userId string, hash string, data string) (*model.Team,
|
||||
props := model.MapFromJson(strings.NewReader(data))
|
||||
|
||||
if hash != utils.HashSha256(fmt.Sprintf("%v:%v", data, utils.Cfg.EmailSettings.InviteSalt)) {
|
||||
return nil, model.NewLocAppError("JoinUserToTeamByHash", "api.user.create_user.signup_link_invalid.app_error", nil, "")
|
||||
return nil, model.NewAppError("JoinUserToTeamByHash", "api.user.create_user.signup_link_invalid.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
t, timeErr := strconv.ParseInt(props["time"], 10, 64)
|
||||
if timeErr != nil || model.GetMillis()-t > 1000*60*60*48 { // 48 hours
|
||||
return nil, model.NewLocAppError("JoinUserToTeamByHash", "api.user.create_user.signup_link_expired.app_error", nil, "")
|
||||
return nil, model.NewAppError("JoinUserToTeamByHash", "api.user.create_user.signup_link_expired.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
tchan := Srv.Store.Team().Get(props["id"])
|
||||
|
||||
Ссылка в новой задаче
Block a user