Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/auth/oauth2/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,5 @@ func (c *Config) Complete() (*completedConfig, error) {
func (a *OAuth2Authenticator) GetOCLoginCommand() string {
return a.ocLoginCommand
}

func (a *OAuth2Authenticator) IsStatic() bool { return false }
1 change: 1 addition & 0 deletions pkg/auth/static/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ func (s *StaticAuthenticator) CallbackFunc(fn func(loginInfo sessions.LoginJSON,
func (s *StaticAuthenticator) GetOCLoginCommand() string { return "" }
func (s *StaticAuthenticator) LogoutRedirectURL() string { return "" }
func (s *StaticAuthenticator) GetSpecialURLs() auth.SpecialAuthURLs { return auth.SpecialAuthURLs{} }
func (s *StaticAuthenticator) IsStatic() bool { return true }
1 change: 1 addition & 0 deletions pkg/auth/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Authenticator interface {
GetOCLoginCommand() string
LogoutRedirectURL() string
GetSpecialURLs() SpecialAuthURLs
IsStatic() bool
}

type SpecialAuthURLs struct {
Expand Down
2 changes: 2 additions & 0 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ type Server struct {
AlertManagerTenancyProxyConfig *proxy.Config
AlertManagerUserWorkloadHost string
AlertManagerUserWorkloadProxyConfig *proxy.Config
AuthDisabled bool
Authenticator auth.Authenticator
BaseURL *url.URL
Branding string
Expand Down Expand Up @@ -664,6 +665,7 @@ func (s *Server) indexHandler(w http.ResponseWriter, r *http.Request) {
}

jsg := &jsGlobals{
AuthDisabled: s.Authenticator.IsStatic(),
ConsoleVersion: version.Version,
BasePath: s.BaseURL.Path,
LoginURL: proxy.SingleJoiningSlash(s.BaseURL.String(), authLoginEndpoint),
Expand Down