From b6c8013cbcd0100266f1bda436aa4075f70beee6 Mon Sep 17 00:00:00 2001 From: Colin Okay Date: Fri, 16 Sep 2022 08:59:41 -0500 Subject: Add: assert-logged-in --- lib/client.lisp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'lib/client.lisp') diff --git a/lib/client.lisp b/lib/client.lisp index e6324aa..527a300 100644 --- a/lib/client.lisp +++ b/lib/client.lisp @@ -319,6 +319,7 @@ running the body. If such a oneliner can be found." ;;; ACCOUNT AND INVITE STUFF (defun request-invite-code () + (assert-logged-in) (let ((invite (jonathan:parse (api:post-invite (api-token) *host*)))) @@ -338,18 +339,21 @@ running the body. If such a oneliner can be found." (config-file)))) (defun change-pw (current new repeated) + (assert-logged-in) (unless (equal new repeated) (error "The new password doesn't match the repeated value. Double check.")) (api:put-contributor/who/password (handle) new repeated current (api-token) *host*)) (defun change-signature () + (assert-logged-in) (let ((new-sig (prompt-for-signature))) - (ensure-config) - (api:put-contributor/who/signature (handle) (api-token) *host* - :%content-type "application/json" - :%body (jonathan:to-json (list :signature new-sig))) - (format t "Your signature was changed.~%"))) + (when new-sig + (ensure-config) + (api:put-contributor/who/signature (handle) (api-token) *host* + :%content-type "application/json" + :%body (jonathan:to-json (list :signature new-sig))) + (format t "Your signature was changed.~%")))) (defun show-contributor (name) -- cgit v1.2.3