diff options
author | Colin Okay <colin@cicadas.surf> | 2022-10-27 13:46:56 -0500 |
---|---|---|
committer | Colin Okay <colin@cicadas.surf> | 2022-10-27 13:46:56 -0500 |
commit | 7ec9075c8a20b4a8f2b1c0de9e5b86e18ad4ae8e (patch) | |
tree | 19930b67e358630a698275ff1dc506020c83d1b6 /vampire.lisp | |
parent | 75926d0ed50473efc106fa83231c862063d0f0c3 (diff) |
Add: auth-pages via a middleware page serving function
Diffstat (limited to 'vampire.lisp')
-rw-r--r-- | vampire.lisp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vampire.lisp b/vampire.lisp index 97266d3..2e8f506 100644 --- a/vampire.lisp +++ b/vampire.lisp @@ -84,6 +84,12 @@ :directory (datastore-directory config) :subsystems (list (make-instance 'bknr.datastore:store-object-subsystem)))) +(defun redirect-to-root (body) + (setf (url (location body)) "/")) + +(defun when-logged-in? (fn) + (<?> 'session-user fn 'redirect-to-root)) + (defun start (config) (setf *config* config) (initialize-database config ) |