From 71ab9b7f14118f02dd18cd733bd4e0ad19ece590 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 20:21:32 +0800 Subject: config shall no longer be a global variable --- http_handle_login.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'http_handle_login.go') 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", -- cgit v1.2.3