aboutsummaryrefslogtreecommitdiff
path: root/lib/client.lisp
diff options
context:
space:
mode:
authorColin Okay <colin@cicadas.surf>2022-09-16 08:59:41 -0500
committerColin Okay <colin@cicadas.surf>2022-09-16 08:59:41 -0500
commitb6c8013cbcd0100266f1bda436aa4075f70beee6 (patch)
treeea124354be27c9f098bbb2b64c0292b1cf53c773 /lib/client.lisp
parent19c805b4eaf8481fd627c4e6b569f2a0e28d3c3a (diff)
Add: assert-logged-in
Diffstat (limited to 'lib/client.lisp')
-rw-r--r--lib/client.lisp14
1 files changed, 9 insertions, 5 deletions
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)