Move config struct to webcontroller

This commit is contained in:
2022-11-07 18:10:06 +01:00
parent db0ae5a322
commit e87bcace2d
6 changed files with 68 additions and 91 deletions

View File

@@ -44,7 +44,7 @@ func (wc *WebController) newTemplateData(w http.ResponseWriter, r *http.Request)
tpm: wc.templates,
Authenticated: false,
UserAgent: r.UserAgent(),
APIEndpoint: template.URL(wc.apiURLExternal),
APIEndpoint: template.URL(wc.config.APIURLExternal),
// Use the user's IP address for making requests
PixelAPI: wc.api.RealIP(util.RemoteAddress(r)).RealAgent(r.UserAgent()),
@@ -74,7 +74,7 @@ func (wc *WebController) newTemplateData(w http.ResponseWriter, r *http.Request)
Value: "",
Path: "/",
Expires: time.Unix(0, 0),
Domain: wc.sessionCookieDomain,
Domain: wc.config.SessionCookieDomain,
})
http.SetCookie(w, &http.Cookie{
Name: "pd_auth_key",