OAuth: Able to skip auto login (#28357)

* OAuth: able to skip auto login

* OAuth: tests for internal login param

* OAuth: rename internal -> disableAutoLogin

* OAuth: update log message

* OAuth: fix tests
This commit is contained in:
Alexander Zobnin
2020-10-20 14:51:06 +03:00
committed by GitHub
parent af17f9fd9b
commit d13c6b4c5a
2 changed files with 42 additions and 0 deletions

View File

@ -81,6 +81,13 @@ func (hs *HTTPServer) LoginView(c *models.ReqContext) {
return
}
urlParams := c.Req.URL.Query()
if _, disableAutoLogin := urlParams["disableAutoLogin"]; disableAutoLogin {
hs.log.Debug("Auto login manually disabled")
c.HTML(200, getViewIndex(), viewData)
return
}
enabledOAuths := make(map[string]interface{})
for key, oauth := range setting.OAuthService.OAuthInfos {
enabledOAuths[key] = map[string]string{"name": oauth.Name}