summaryrefslogtreecommitdiff
path: root/lisp/service/password-service.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/service/password-service.lisp')
-rw-r--r--lisp/service/password-service.lisp21
1 files changed, 12 insertions, 9 deletions
diff --git a/lisp/service/password-service.lisp b/lisp/service/password-service.lisp
index 32507d2..ab35f09 100644
--- a/lisp/service/password-service.lisp
+++ b/lisp/service/password-service.lisp
@@ -12,6 +12,13 @@
:accessor title))
(:documentation ""))
+(defclass password/modify-service (password-service)
+ ((form :initarg :form
+ :initform nil
+ :accessor form)
+ (location-p :initform nil))
+ (:documentation ""))
+
(defun password-json ()
(with-auth (instance password-service "profile-modify")
(let ((user (get-user)))
@@ -24,13 +31,6 @@
(:name "pwd2" :label "Password (again)" :field-type "password" :required "required")
(:label "Change Password" :field-type "button" :onclick "on_password_submit_clicked()")))))))
-(defclass password/modify-service (password-service)
- ((form :initarg :form
- :initform nil
- :accessor form)
- (location-p :initform nil))
- (:documentation ""))
-
(defun password-submit-json (id pwd pwd2)
(declare (special pwd pwd2))
(with-auth (instance password/modify-service "profile-modify")
@@ -46,5 +46,8 @@
do (setf (slot-value user param) (symbol-value param)))
(update-password auth-pkg user)
(set-user user)
- (setf (session-value :message) "Password saved successfully."))
- (setf (session-value :errormsg) "An error occured."))))))
+ (setf (message instance) "Password saved successfully."))
+ (setf (errormsg instance) "An error occured."))))))
+
+(define-endpoint ("/password" :method :get) () password-json)
+(define-endpoint ("/password/submit" :method :post) (&post (id :parameter-type 'integer) (pwd :parameter-type 'string) (pwd2 :parameter-type 'string)) password-submit-json id pwd pwd2)