diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-04-27 10:55:03 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-04-27 10:55:03 -0400 |
commit | 9a87bb3af68216b53ee8f89d6604c715c7b85b2d (patch) | |
tree | 8c06aed890f388b228f3aefb8e398309bc73c0b9 /model/client4.go | |
parent | 0e007e344bf10993529711f14c4168365c3504c3 (diff) | |
download | chat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.tar.gz chat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.tar.bz2 chat-9a87bb3af68216b53ee8f89d6604c715c7b85b2d.zip |
Creating common token store and moving email invites and verification to it (#6213)
Diffstat (limited to 'model/client4.go')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/model/client4.go b/model/client4.go index a33e62846..3a6507f82 100644 --- a/model/client4.go +++ b/model/client4.go @@ -751,8 +751,8 @@ func (c *Client4) SendPasswordResetEmail(email string) (bool, *Response) { } // ResetPassword uses a recovery code to update reset a user's password. -func (c *Client4) ResetPassword(code, newPassword string) (bool, *Response) { - requestBody := map[string]string{"code": code, "new_password": newPassword} +func (c *Client4) ResetPassword(token, newPassword string) (bool, *Response) { + requestBody := map[string]string{"token": token, "new_password": newPassword} if r, err := c.DoApiPost(c.GetUsersRoute()+"/password/reset", MapToJson(requestBody)); err != nil { return false, &Response{StatusCode: r.StatusCode, Error: err} } else { @@ -821,9 +821,9 @@ func (c *Client4) GetUserAudits(userId string, page int, perPage int, etag strin } } -// VerifyUserEmail will verify a user's email using user id and hash strings. -func (c *Client4) VerifyUserEmail(userId, hashId string) (bool, *Response) { - requestBody := map[string]string{"user_id": userId, "hash_id": hashId} +// VerifyUserEmail will verify a user's email using the supplied token. +func (c *Client4) VerifyUserEmail(token string) (bool, *Response) { + requestBody := map[string]string{"token": token} if r, err := c.DoApiPost(c.GetUsersRoute()+"/email/verify", MapToJson(requestBody)); err != nil { return false, &Response{StatusCode: r.StatusCode, Error: err} } else { |