MM-9779: Incorporate a Token into the invitations system (#8604)
* Incorporate a Token into the invitations system * Adding unit tests * Fixing some api4 client tests * Removing unnecesary hash validation * Change the Hash concept on invitations with tokenId * Not send invitation if it wasn't able to create the Token * Fixing some naming problems * Changing the hash query params received from the client side * Removed unneded data param in the token usage
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
b13a228b04
Коммит
0910eae31d
@@ -376,15 +376,14 @@ func addTeamMember(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func addUserToTeamFromInvite(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
hash := r.URL.Query().Get("hash")
|
||||
data := r.URL.Query().Get("data")
|
||||
tokenId := r.URL.Query().Get("token")
|
||||
inviteId := r.URL.Query().Get("invite_id")
|
||||
|
||||
var member *model.TeamMember
|
||||
var err *model.AppError
|
||||
|
||||
if len(hash) > 0 && len(data) > 0 {
|
||||
member, err = c.App.AddTeamMemberByHash(c.Session.UserId, hash, data)
|
||||
if len(tokenId) > 0 {
|
||||
member, err = c.App.AddTeamMemberByToken(c.Session.UserId, tokenId)
|
||||
} else if len(inviteId) > 0 {
|
||||
member, err = c.App.AddTeamMemberByInviteId(inviteId, c.Session.UserId)
|
||||
} else {
|
||||
|
||||
Ссылка в новой задаче
Block a user