MM-15889 Add unit tests for CSRF checks (#11058)

* MM-15889 Add unit tests for CSRF checks

* Moved CSRF token test to login tests

* Remove empty test

* Remove debug messages
Этот коммит содержится в:
Harrison Healey
2019-06-11 15:09:00 -04:00
коммит произвёл GitHub
родитель 28cf642ccb
Коммит 803ce61ef8
8 изменённых файлов: 300 добавлений и 80 удалений

Просмотреть файл

@@ -515,7 +515,6 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) {
if action == model.OAUTH_ACTION_EMAIL_TO_SSO {
redirectUrl = c.GetSiteURLHeader() + "/login?extra=signin_change"
} else if action == model.OAUTH_ACTION_SSO_TO_EMAIL {
redirectUrl = app.GetProtocol(r) + "://" + r.Host + "/claim?email=" + url.QueryEscape(props["email"])
} else {
session, err := c.App.DoLogin(w, r, user, "")
@@ -528,6 +527,8 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
c.App.AttachSessionCookies(w, r, session)
c.App.Session = *session
if _, ok := props["redirect_to"]; ok {