summaryrefslogtreecommitdiff
path: root/login.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-10-27 13:13:21 -0500
committerColin Okay <colin@cicadas.surf>2022-10-27 13:13:21 -0500
commit75926d0ed50473efc106fa83231c862063d0f0c3 (patch)
treeb0f2c20d47670868a7b8524c69a8ed499b64de3d /login.lisp
parentfda05f8ce638987d332c8aff4043afa74e52523f (diff)
Add: logging in with pw
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.")))))))