aboutsummaryrefslogtreecommitdiffhomepage
path: root/model.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2023-01-01 08:48:50 -0800
committercolin <colin@cicadas.surf>2023-01-01 08:48:50 -0800
commit7a3b904c26e2a08a88f58684d03aff3fb2a39c86 (patch)
treee25e9f241715ec9003f10f8b2e704264e87bbf80 /model.lisp
parentc0ff3d5317e2a70329fde1b56b52dfa203f9c445 (diff)
Add: password reset feature
Diffstat (limited to 'model.lisp')
-rw-r--r--model.lisp7
1 files changed, 7 insertions, 0 deletions
diff --git a/model.lisp b/model.lisp
index ca78698..5a06fe2 100644
--- a/model.lisp
+++ b/model.lisp
@@ -99,6 +99,13 @@
(with-transaction ()
(make-instance 'user :name name)))
+(defun set-new-password (user pw)
+ (with-transaction ()
+ (setf (user-pwhash user)
+ (hash-string pw (user-pwsalt user)))
+ t))
+
+
(defun use-invite-with-code (code username pw)
(with-transaction ()
(when-let (invite (invite-by-code code))