From 0910eae31de8ed7b409654515dbd11f5c86dbf71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 18 Apr 2018 22:46:10 +0200 Subject: 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 --- api4/user.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api4/user.go') diff --git a/api4/user.go b/api4/user.go index f5c56656c..e13bf9448 100644 --- a/api4/user.go +++ b/api4/user.go @@ -73,15 +73,15 @@ func createUser(c *Context, w http.ResponseWriter, r *http.Request) { return } - hash := r.URL.Query().Get("h") + tokenId := r.URL.Query().Get("t") inviteId := r.URL.Query().Get("iid") // No permission check required var ruser *model.User var err *model.AppError - if len(hash) > 0 { - ruser, err = c.App.CreateUserWithHash(user, hash, r.URL.Query().Get("d")) + if len(tokenId) > 0 { + ruser, err = c.App.CreateUserWithToken(user, tokenId) } else if len(inviteId) > 0 { ruser, err = c.App.CreateUserWithInviteId(user, inviteId) } else if c.IsSystemAdmin() { -- cgit v1.2.3-1-g7c22