Creating common token store and moving email invites and verification to it (#6213)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
0e007e344b
Коммит
9a87bb3af6
@@ -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 {
|
||||
|
||||
Ссылка в новой задаче
Block a user