diff options
Diffstat (limited to 'site')
-rw-r--r-- | site/home.lisp | 22 | ||||
-rw-r--r-- | site/login.lisp | 10 |
2 files changed, 32 insertions, 0 deletions
diff --git a/site/home.lisp b/site/home.lisp new file mode 100644 index 0000000..97c2a87 --- /dev/null +++ b/site/home.lisp @@ -0,0 +1,22 @@ +(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))) + +(defun home-page (user) + (format nil "hey ~a" (user-name user))) + +(wknd:defendpoint home + :using user-known + :get :route "" + :returns "text/html" + :handle (home-page user)) diff --git a/site/login.lisp b/site/login.lisp new file mode 100644 index 0000000..afbd80e --- /dev/null +++ b/site/login.lisp @@ -0,0 +1,10 @@ +(in-package #:vampire) + +(defun login-page () + "login") + +(wknd:defendpoint login + :get :route "login" + :returns "text/html" + :handle (login-page)) + |