diff --git a/assets/pages/login.vue b/assets/pages/login.vue index 5338ded7793b..42fef410df7e 100644 --- a/assets/pages/login.vue +++ b/assets/pages/login.vue @@ -50,8 +50,7 @@ let form: HTMLFormElement | undefined = $ref(); const params = new URLSearchParams(window.location.search); async function onLogin() { - const url = config.authProvider === "simple" ? "/api/token" : "/api/validateCredentials"; - const response = await fetch(withBase(url), { + const response = await fetch(withBase("/api/token"), { body: new FormData(form), method: "POST", }); diff --git a/assets/stores/config.ts b/assets/stores/config.ts index 0ca6a83ea19a..f2e64d32ebc5 100644 --- a/assets/stores/config.ts +++ b/assets/stores/config.ts @@ -29,6 +29,8 @@ const pageConfig = JSON.parse(text); const config: Config = { maxLogs: 600, + version: "v0.0.0", + hosts: [], ...pageConfig, }; diff --git a/internal/web/index.go b/internal/web/index.go index ad25e3622b99..028a87787375 100644 --- a/internal/web/index.go +++ b/internal/web/index.go @@ -52,15 +52,19 @@ func (h *handler) executeTemplate(w http.ResponseWriter, req *http.Request) { }) config := map[string]interface{}{ - "base": base, - "version": h.config.Version, - "hostname": h.config.Hostname, - "hosts": hosts, - "authProvider": h.config.Authorization.Provider, - "enableActions": h.config.EnableActions, + "base": base, } user := auth.UserFromContext(req.Context()) + + if h.config.Authorization.Provider == NONE || user != nil { + config["authProvider"] = h.config.Authorization.Provider + config["version"] = h.config.Version + config["hostname"] = h.config.Hostname + config["hosts"] = hosts + config["enableActions"] = h.config.EnableActions + } + if user != nil { if profile, err := profile.Load(*user); err == nil { config["profile"] = profile diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 000000000000..1f53798bb4fe --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /