Remove auth_mode
This commit is contained in:
@@ -620,13 +620,9 @@ func (s *Server) handleWebConfig(w http.ResponseWriter, _ *http.Request, v *visi
|
||||
}
|
||||
|
||||
func (s *Server) configResponse(v *visitor) *apiConfigResponse {
|
||||
authMode := ""
|
||||
username := ""
|
||||
if s.config.AuthUserHeader != "" {
|
||||
authMode = "proxy"
|
||||
if v != nil && v.User() != nil {
|
||||
username = v.User().Name
|
||||
}
|
||||
authUser := ""
|
||||
if s.config.AuthUserHeader != "" && v != nil && v.User() != nil {
|
||||
authUser = v.User().Name
|
||||
}
|
||||
return &apiConfigResponse{
|
||||
BaseURL: "", // Will translate to window.location.origin
|
||||
@@ -643,9 +639,8 @@ func (s *Server) configResponse(v *visitor) *apiConfigResponse {
|
||||
WebPushPublicKey: s.config.WebPushPublicKey,
|
||||
DisallowedTopics: s.config.DisallowedTopics,
|
||||
ConfigHash: s.config.Hash(),
|
||||
AuthMode: authMode,
|
||||
AuthLogoutURL: s.config.AuthLogoutURL,
|
||||
Username: username,
|
||||
AuthUser: authUser,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -483,9 +483,8 @@ type apiConfigResponse struct {
|
||||
WebPushPublicKey string `json:"web_push_public_key"`
|
||||
DisallowedTopics []string `json:"disallowed_topics"`
|
||||
ConfigHash string `json:"config_hash"`
|
||||
AuthMode string `json:"auth_mode,omitempty"` // "proxy" if auth-user-header is set, empty otherwise
|
||||
AuthLogoutURL string `json:"auth_logout_url,omitempty"` // URL to redirect to on logout (only for proxy auth)
|
||||
Username string `json:"username,omitempty"` // Authenticated username (for proxy auth)
|
||||
AuthUser string `json:"auth_user,omitempty"` // Authenticated username (for proxy auth, empty if not using proxy auth)
|
||||
}
|
||||
|
||||
type apiAccountBillingPrices struct {
|
||||
|
||||
Reference in New Issue
Block a user