summaryrefslogtreecommitdiff
path: root/login.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'login.lisp')
-rw-r--r--login.lisp12
1 files changed, 11 insertions, 1 deletions
diff --git a/login.lisp b/login.lisp
index 2e7c652..1eb3955 100644
--- a/login.lisp
+++ b/login.lisp
@@ -17,5 +17,15 @@
(:p ()
(:a (:link "/new-account" :content "Create an account")))))
(setf (place-holder name-input) "Name"
- (place-holder pw-input) "Password")))
+ (place-holder pw-input) "Password")
+ (set-on-click
+ btn
+ (thunk*
+ (let ((user
+ (login-user (value name-input) (value pw-input))))
+ (if user
+ (let ((session (make-session user)))
+ (setf (session-key (window body)) (key session)
+ (url (location body)) "/home"))
+ (alert (window body) "Error logging in.")))))))