diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-01-04 15:55:51 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-01-04 15:55:51 -0500 |
commit | 67db3ca8ce5e78ee55c37a3dbfb8e5d44037a324 (patch) | |
tree | 6ffac556a09192e7042d7ab2c184382286338c90 /model/client.go | |
parent | 07efe758609929e662185199e8c5a273b0fb0007 (diff) | |
parent | a6ae90ac2a74871331707751e823b4746136ff09 (diff) | |
download | chat-67db3ca8ce5e78ee55c37a3dbfb8e5d44037a324.tar.gz chat-67db3ca8ce5e78ee55c37a3dbfb8e5d44037a324.tar.bz2 chat-67db3ca8ce5e78ee55c37a3dbfb8e5d44037a324.zip |
Merge pull request #1745 from mattermost/plt-1118
PLT-1118 Add ability to switch between SSO and email account
Diffstat (limited to 'model/client.go')
-rw-r--r-- | model/client.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/model/client.go b/model/client.go index b9b97dedc..f1773f3c7 100644 --- a/model/client.go +++ b/model/client.go @@ -349,6 +349,24 @@ func (c *Client) GetSessions(id string) (*Result, *AppError) { } } +func (c *Client) SwitchToSSO(m map[string]string) (*Result, *AppError) { + if r, err := c.DoApiPost("/users/switch_to_sso", MapToJson(m)); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil + } +} + +func (c *Client) SwitchToEmail(m map[string]string) (*Result, *AppError) { + if r, err := c.DoApiPost("/users/switch_to_email", MapToJson(m)); err != nil { + return nil, err + } else { + return &Result{r.Header.Get(HEADER_REQUEST_ID), + r.Header.Get(HEADER_ETAG_SERVER), MapFromJson(r.Body)}, nil + } +} + func (c *Client) Command(channelId string, command string, suggest bool) (*Result, *AppError) { m := make(map[string]string) m["command"] = command |