Skip to content

Commit

Permalink
Pass localAuthEnabled flag to UI (#3412)
Browse files Browse the repository at this point in the history
* Added LocalAuthEnabled prop to WebConfigAuthSetting struct in webconfig.go
* Added LocalAuthEnabled state as part of webCfg in  apiserver.go
  • Loading branch information
Lisa Kim authored and alex-kovoy committed Apr 15, 2020
1 parent 82565a9 commit 0446cdd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/web/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,9 @@ func (h *Handler) getWebConfig(w http.ResponseWriter, r *http.Request, p httprou
}

authSettings := ui.WebConfigAuthSettings{
Providers: authProviders,
SecondFactor: secondFactor,
Providers: authProviders,
SecondFactor: secondFactor,
LocalAuthEnabled: clsCfg.GetLocalAuth(),
}

webCfg := ui.WebConfig{
Expand Down
2 changes: 2 additions & 0 deletions lib/web/ui/webconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,6 @@ type WebConfigAuthSettings struct {
SecondFactor string `json:"second_factor,omitempty"`
// Providers contains a list of configured auth providers
Providers []WebConfigAuthProvider `json:"providers,omitempty"`
// LocalAuthEnabled is a flag that enables local authentication
LocalAuthEnabled bool `json:"localAuthEnabled"`
}

0 comments on commit 0446cdd

Please sign in to comment.