summaryrefslogtreecommitdiff
path: root/site/user-known.lisp
diff options
context:
space:
mode:
authorGrant Shangreaux <grant@unabridgedsoftware.com>2024-05-31 13:39:05 -0500
committerGrant Shangreaux <grant@unabridgedsoftware.com>2024-05-31 13:39:05 -0500
commit9b51a908448c23eff673934f023d247a6c47519d (patch)
tree89384c75ed8d2b8add927b1584267847e6ab0ea4 /site/user-known.lisp
parent2832a7c9e75400e36ca12a028ffcbeece44c8216 (diff)
Add: initial login form and authentication
Diffstat (limited to 'site/user-known.lisp')
-rw-r--r--site/user-known.lisp13
1 files changed, 13 insertions, 0 deletions
diff --git a/site/user-known.lisp b/site/user-known.lisp
new file mode 100644
index 0000000..1c48c9a
--- /dev/null
+++ b/site/user-known.lisp
@@ -0,0 +1,13 @@
+(in-package #:vampire)
+
+(defclass user-known ()
+ ((user :accessor user)))
+
+(defmethod wknd:authenticate ((req user-known))
+ (or
+ (do>
+ key :when= (wknd:get-cookie +session-cookie+)
+ session :when= (object-with-key key)
+ :when (typep session 'session)
+ (setf (user req) (user session)))
+ (weekend:endpoint-redirect 'login)))