summaryrefslogtreecommitdiff
path: root/session.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-27 07:52:50 -0500
committerColin Okay <colin@cicadas.surf>2022-10-27 07:52:50 -0500
commit0b21729661ed1905eb886b1eba6f8b062305c9a3 (patch)
treec3071c5238d1dc174bfaf42ccad59a88d710f043 /session.lisp
parent52c0408569a0b1de932d52e71fee5fb0163782e2 (diff)
Modify+Add: Added pw hashing stuff to user. Add login file.
Diffstat (limited to 'session.lisp')
-rw-r--r--session.lisp11
1 files changed, 9 insertions, 2 deletions
diff --git a/session.lisp b/session.lisp
index 770bc8d..0ad10c2 100644
--- a/session.lisp
+++ b/session.lisp
@@ -2,7 +2,12 @@
(in-package :vampire)
-;;; session parameter keys
+;;; SESSION CLASS
+
+(defclass/bknr session (keyed)
+ ((user :std (error "Sessions must be associated with users."))))
+
+;;; SESSION PARAMETER KEYS
(defparameter +session-key+ "vampire-session-key"
"Stored in the browser's local storage")
@@ -19,7 +24,9 @@
(setf (storage-element window :local +session-key+) (jonathan:to-json val)))
(defun session-user (clog-obj)
- (user-with-key (session-key (window (connection-body clog-obj)))))
+ (when-let (obj (object-with-key (session-key (window (connection-body clog-obj)))))
+ (when (typep obj 'session)
+ (user obj))))
(defun cur-playlist-ctl (obj)
(connection-data-item obj +playlist-connection-key+))