From 75926d0ed50473efc106fa83231c862063d0f0c3 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Thu, 27 Oct 2022 13:13:21 -0500 Subject: Add: logging in with pw --- login.lisp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'login.lisp') 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."))))))) -- cgit v1.2.3