From 9a87bb3af68216b53ee8f89d6604c715c7b85b2d Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Thu, 27 Apr 2017 10:55:03 -0400 Subject: Creating common token store and moving email invites and verification to it (#6213) --- api/oauth_test.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'api/oauth_test.go') diff --git a/api/oauth_test.go b/api/oauth_test.go index 014facb44..3d71d8e90 100644 --- a/api/oauth_test.go +++ b/api/oauth_test.go @@ -5,16 +5,17 @@ package api import ( "encoding/base64" - "github.com/mattermost/platform/app" - "github.com/mattermost/platform/einterfaces" - "github.com/mattermost/platform/model" - "github.com/mattermost/platform/utils" "io" "io/ioutil" "net/http" "net/url" "strings" "testing" + + "github.com/mattermost/platform/app" + "github.com/mattermost/platform/einterfaces" + "github.com/mattermost/platform/model" + "github.com/mattermost/platform/utils" ) func TestOAuthRegisterApp(t *testing.T) { @@ -735,7 +736,7 @@ func TestOAuthComplete(t *testing.T) { closeBody(r) } - stateProps["hash"] = model.HashPassword(utils.Cfg.GitLabSettings.Id) + stateProps["hash"] = utils.HashSha256(utils.Cfg.GitLabSettings.Id) state = base64.StdEncoding.EncodeToString([]byte(model.MapToJson(stateProps))) if r, err := HttpGet(Client.Url+"/login/gitlab/complete?code=123&state="+url.QueryEscape(state), Client.HttpClient, "", true); err == nil { t.Fatal("should have failed - no connection") @@ -771,7 +772,7 @@ func TestOAuthComplete(t *testing.T) { stateProps["action"] = model.OAUTH_ACTION_EMAIL_TO_SSO delete(stateProps, "team_id") stateProps["redirect_to"] = utils.Cfg.GitLabSettings.AuthEndpoint - stateProps["hash"] = model.HashPassword(utils.Cfg.GitLabSettings.Id) + stateProps["hash"] = utils.HashSha256(utils.Cfg.GitLabSettings.Id) stateProps["redirect_to"] = "/oauth/authorize" state = base64.StdEncoding.EncodeToString([]byte(model.MapToJson(stateProps))) if r, err := HttpGet(Client.Url+"/login/"+model.SERVICE_GITLAB+"/complete?code="+url.QueryEscape(code)+"&state="+url.QueryEscape(state), Client.HttpClient, "", false); err == nil { -- cgit v1.2.3-1-g7c22