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
Этот коммит содержится в:
Jesús Espino
2018-04-18 22:46:10 +02:00
коммит произвёл Christopher Speller
родитель b13a228b04
Коммит 0910eae31d
15 изменённых файлов: 349 добавлений и 170 удалений

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

@@ -76,13 +76,13 @@ 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")
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 {