[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Can :auth and :cookies be in the same controller?
From: |
Mortimer Cladwell |
Subject: |
Can :auth and :cookies be in the same controller? |
Date: |
Fri, 22 Jan 2021 16:17:27 -0500 |
Hi,
Seems like no:
-----BEGIN--------Input Form----../plateset/testcset--------------
<html></body><h1>Test</h1><br><br>
<form action="" method="post" >
<label for="" type="submit" value="Submit">
</form></body></html>
----END--------------------------------------------------------------------
-----BEGIN--------Controller------------------
(post "/cset"
#:auth `(table person "lnuser" "passwd" "salt" ,my-hmac)
#:cookies '(names prjid sid lnuser)
(lambda (rc)
(let* ((result "sometext")
(dummy (:cookies-set! rc 'prjid "prjid" result)))
(view-render "test" (the-environment)))))
----END--------------------------------------------------------------------
----BEGIN-----Output page----------------------------------------------------
<html></body>
<h1>Test</h1><br><br>
check cookies
</body></html>
----END----------------------------------------------------------------
If I submit ../plateset/testcset and click the "submit" button I get the error:
In app/controllers/plateset.scm:
512:33 2 (_ _)
In artanis/oht.scm:
209:8 1 (_ _ _ _)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)
Throw to key `artansi-err' with args `(500 #<procedure cget (ckl ck)> "Undefined cookie name" prjid)'.
HTTP 500
Captured in <artanis/server/ragnarok.scm>
Threw in procedure handle-request :
[REASON] Internal ERROR artansi-err (500 #<procedure cget (ckl ck)> Undefined cookie name prjid)!
[SERVER ERROR] Internal error from server-side, rendering a 500 page for client ...
If I comment out #:auth `(table person "lnuser" "passwd" "salt" ,my-hmac) and resubmit I can set the cookie.
Note that when #:auth is active, I am not using it in any way. Seems like its presence is the problem.
Any ideas?
Thanks
Mortimer
- Can :auth and :cookies be in the same controller?,
Mortimer Cladwell <=