aboutsummaryrefslogtreecommitdiff
path: root/http_handle_login.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
commit71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch)
tree0303cbee651a4e1cee62a348d25066b9543f4425 /http_handle_login.go
parentgit2d: Remove UTF-8 checks (diff)
downloadforge-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.go4
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",