diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-09-18 12:16:53 -0400 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-09-18 12:16:53 -0400 |
commit | c42a547b4fcd38e065ad2f702110395e9c76cb67 (patch) | |
tree | 3a9790f08768bd90bbb05fd55bfc18ead396f990 | |
parent | 6eb32591d978240fb77696f0b8697e81832883bb (diff) | |
download | chat-c42a547b4fcd38e065ad2f702110395e9c76cb67.tar.gz chat-c42a547b4fcd38e065ad2f702110395e9c76cb67.tar.bz2 chat-c42a547b4fcd38e065ad2f702110395e9c76cb67.zip |
Fix authentication for loadtests.
-rw-r--r-- | api/command.go | 6 | ||||
-rw-r--r-- | model/client.go | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/api/command.go b/api/command.go index be1d3229b..bc55f206b 100644 --- a/api/command.go +++ b/api/command.go @@ -341,7 +341,7 @@ func loadTestSetupCommand(c *Context, command *model.Command) bool { } } } else { - client.MockSession(c.Session.Id) + client.MockSession(c.Session.Token) CreateTestEnviromentInTeam( client, c.Session.TeamId, @@ -406,7 +406,7 @@ func loadTestChannelsCommand(c *Context, command *model.Command) bool { channelsr = utils.Range{20, 30} } client := model.NewClient(c.GetSiteURL()) - client.MockSession(c.Session.Id) + client.MockSession(c.Session.Token) channelCreator := NewAutoChannelCreator(client, c.Session.TeamId) channelCreator.Fuzzy = doFuzz channelCreator.CreateTestChannels(channelsr) @@ -458,7 +458,7 @@ func loadTestPostsCommand(c *Context, command *model.Command) bool { } client := model.NewClient(c.GetSiteURL()) - client.MockSession(c.Session.Id) + client.MockSession(c.Session.Token) testPoster := NewAutoPostCreator(client, command.ChannelId) testPoster.Fuzzy = doFuzz testPoster.Users = usernames diff --git a/model/client.go b/model/client.go index 9a89e8208..1e2ac59ac 100644 --- a/model/client.go +++ b/model/client.go @@ -790,4 +790,5 @@ func (c *Client) GetAccessToken(data url.Values) (*Result, *AppError) { func (c *Client) MockSession(sessionToken string) { c.AuthToken = sessionToken + c.AuthType = HEADER_BEARER } |