Commit 44a2a648 by Dominik Prokop Committed by GitHub

Login: fix login page failing when navigating from reset password views (#19124)

parent e968a2aa
...@@ -179,6 +179,9 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf ...@@ -179,6 +179,9 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
"exploreEnabled": setting.ExploreEnabled, "exploreEnabled": setting.ExploreEnabled,
"googleAnalyticsId": setting.GoogleAnalyticsId, "googleAnalyticsId": setting.GoogleAnalyticsId,
"disableLoginForm": setting.DisableLoginForm, "disableLoginForm": setting.DisableLoginForm,
"disableUserSignUp": !setting.AllowUserSignUp,
"loginHint": setting.LoginHint,
"passwordHint": setting.PasswordHint,
"externalUserMngInfo": setting.ExternalUserMngInfo, "externalUserMngInfo": setting.ExternalUserMngInfo,
"externalUserMngLinkUrl": setting.ExternalUserMngLinkUrl, "externalUserMngLinkUrl": setting.ExternalUserMngLinkUrl,
"externalUserMngLinkName": setting.ExternalUserMngLinkName, "externalUserMngLinkName": setting.ExternalUserMngLinkName,
......
...@@ -40,10 +40,6 @@ func (hs *HTTPServer) LoginView(c *models.ReqContext) { ...@@ -40,10 +40,6 @@ func (hs *HTTPServer) LoginView(c *models.ReqContext) {
} }
viewData.Settings["oauth"] = enabledOAuths viewData.Settings["oauth"] = enabledOAuths
viewData.Settings["disableUserSignUp"] = !setting.AllowUserSignUp
viewData.Settings["loginHint"] = setting.LoginHint
viewData.Settings["passwordHint"] = setting.PasswordHint
viewData.Settings["disableLoginForm"] = setting.DisableLoginForm
viewData.Settings["samlEnabled"] = setting.IsEnterprise && hs.Cfg.SAMLEnabled viewData.Settings["samlEnabled"] = setting.IsEnterprise && hs.Cfg.SAMLEnabled
if loginError, ok := tryGetEncryptedCookie(c, LoginErrorCookieName); ok { if loginError, ok := tryGetEncryptedCookie(c, LoginErrorCookieName); ok {
......
...@@ -9,7 +9,9 @@ import { getBackendSrv } from '@grafana/runtime'; ...@@ -9,7 +9,9 @@ import { getBackendSrv } from '@grafana/runtime';
import { hot } from 'react-hot-loader'; import { hot } from 'react-hot-loader';
import appEvents from 'app/core/app_events'; import appEvents from 'app/core/app_events';
const isOauthEnabled = () => Object.keys(config.oauth).length > 0; const isOauthEnabled = () => {
return !!config.oauth && Object.keys(config.oauth).length > 0;
};
export interface FormModel { export interface FormModel {
user: string; user: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment