summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-10-24 09:00:05 -0700
committerGitHub <noreply@github.com>2017-10-24 09:00:05 -0700
commit2a2af0e390e0323e02919598881783f38131b5ee (patch)
treee8e9dc4e3d7aecb93f0b67b1f6dcf238af7deadb /api4
parent673df81669ebb1f8ec278f3cb86fadcc09f5d030 (diff)
downloadchat-2a2af0e390e0323e02919598881783f38131b5ee.tar.gz
chat-2a2af0e390e0323e02919598881783f38131b5ee.tar.bz2
chat-2a2af0e390e0323e02919598881783f38131b5ee.zip
eliminate more utils.Cfg references (#7701)
Diffstat (limited to 'api4')
-rw-r--r--api4/user_test.go26
-rw-r--r--api4/webrtc.go3
2 files changed, 1 insertions, 28 deletions
diff --git a/api4/user_test.go b/api4/user_test.go
index 974156ae5..eee9aa8a2 100644
--- a/api4/user_test.go
+++ b/api4/user_test.go
@@ -1517,32 +1517,6 @@ func TestUpdateUserMfa(t *testing.T) {
_, resp := Client.UpdateUserMfa(th.BasicUser.Id, "12345", false)
CheckForbiddenStatus(t, resp)
-
- /*
- team := model.Team{DisplayName: "Name", Name: "z-z-" + model.NewId() + "a", Email: "test@nowhere.com", Type: model.TEAM_OPEN}
- rteam, _ := Client.CreateTeam(&team)
-
- user := model.User{Email: strings.ToLower(model.NewId()) + "success+test@simulator.amazonses.com", Nickname: "Corey Hulen", Password: "passwd1"}
- ruser, _ := Client.CreateUser(&user)
- th.LinkUserToTeam(ruser, rteam)
- store.Must(app.Srv.Store.User().VerifyEmail(ruser.Id))
-
- Client.Logout()
- _, resp := Client.UpdateUserMfa(ruser.Id, "12334", true)
- CheckUnauthorizedStatus(t, resp)
-
- Client.Login(user.Email, user.Password)
- _, resp = Client.UpdateUserMfa("fail", "56789", false)
- CheckBadRequestStatus(t, resp)
-
- _, resp = Client.UpdateUserMfa(ruser.Id, "", true)
- CheckErrorMessage(t, resp, "api.context.invalid_body_param.app_error")
-
- *utils.Cfg.ServiceSettings.EnableMultifactorAuthentication = true
-
- _, resp = Client.UpdateUserMfa(ruser.Id, "123456", false)
- CheckNotImplementedStatus(t, resp)
- */
}
func TestCheckUserMfa(t *testing.T) {
diff --git a/api4/webrtc.go b/api4/webrtc.go
index bf418d5e8..9fcc18ff9 100644
--- a/api4/webrtc.go
+++ b/api4/webrtc.go
@@ -7,7 +7,6 @@ import (
"net/http"
l4g "github.com/alecthomas/log4go"
- "github.com/mattermost/mattermost-server/app"
"github.com/mattermost/mattermost-server/utils"
)
@@ -18,7 +17,7 @@ func (api *API) InitWebrtc() {
}
func webrtcToken(c *Context, w http.ResponseWriter, r *http.Request) {
- result, err := app.GetWebrtcInfoForSession(c.Session.Id)
+ result, err := c.App.GetWebrtcInfoForSession(c.Session.Id)
if err != nil {
c.Err = err