diff options
Diffstat (limited to 'http_handle_login.go')
-rw-r--r-- | http_handle_login.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/http_handle_login.go b/http_handle_login.go index 2d2dbf6..0785ecc 100644 --- a/http_handle_login.go +++ b/http_handle_login.go @@ -57,6 +57,11 @@ func handle_login(w http.ResponseWriter, r *http.Request, params map[string]any) } cookie_value, err := random_urlsafe_string(16) + if err != nil { + http.Error(w, "Error getting random string: "+err.Error(), http.StatusInternalServerError) + return + } + now := time.Now() expiry := now.Add(time.Duration(config.HTTP.CookieExpiry) * time.Second) |