diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:21:32 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 20:21:32 +0800 |
commit | 71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch) | |
tree | 0303cbee651a4e1cee62a348d25066b9543f4425 /http_handle_login.go | |
parent | git2d: Remove UTF-8 checks (diff) | |
download | forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip |
config shall no longer be a global variable
Diffstat (limited to 'http_handle_login.go')
-rw-r--r-- | http_handle_login.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/http_handle_login.go b/http_handle_login.go index 56c0a82..ea1dbae 100644 --- a/http_handle_login.go +++ b/http_handle_login.go @@ -16,7 +16,7 @@ import ( ) // httpHandleLogin provides the login page for local users. -func httpHandleLogin(writer http.ResponseWriter, request *http.Request, params map[string]any) { +func (s *server) httpHandleLogin(writer http.ResponseWriter, request *http.Request, params map[string]any) { var username, password string var userID int var passwordHash string @@ -71,7 +71,7 @@ func httpHandleLogin(writer http.ResponseWriter, request *http.Request, params m } now = time.Now() - expiry = now.Add(time.Duration(config.HTTP.CookieExpiry) * time.Second) + expiry = now.Add(time.Duration(s.config.HTTP.CookieExpiry) * time.Second) cookie = http.Cookie{ Name: "session", |