summaryrefslogtreecommitdiffstats
path: root/api/oauth_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/oauth_test.go')
-rw-r--r--api/oauth_test.go13
1 files changed, 7 insertions, 6 deletions
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 {