controller: Don't generate signing key when evaluating the file.
authorRicardo Wurmus <rekado@elephly.net>
Sun, 10 May 2020 14:22:12 +0000 (16:22 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Sun, 10 May 2020 14:22:12 +0000 (16:22 +0200)
mumi/web/controller.scm

index 23317bb5001a452b26a04d86703245f0a1a4889b..290ff6beda4f4ee15d48f2cd71e67e7f73e61c3e 100644 (file)
@@ -40,7 +40,7 @@
         target
         (list functions ...)))
 
-(define %session-manager
+(define (%session-manager)
   (let ((key-file (string-append (%config 'key-dir) "/signing-key")))
     (unless (file-exists? key-file)
       (with-output-to-file key-file
            ;; Record the current issue id in an encrypted cookie.
            ;; This will be verified when posting a comment.
            (let* ((cookie-header
-                   (set-session %session-manager `((issue-id . ,id))))
+                   (set-session (%session-manager) `((issue-id . ,id))))
                   (headers
                    (cond
                     ((bug-archived bug)
      (if (mailer-enabled?)
          (let ((headers   (request-headers request))
                (form-data (parse-form-submission request body))
-               (cookie    (or (session-data %session-manager request)
+               (cookie    (or (session-data (%session-manager) request)
                               '()))
                (bug       (fetch-bug id)))
            (if (and