aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-28 15:45:08 -0600
committerColin Okay <okay@toyful.space>2022-02-28 15:45:08 -0600
commit0cd6911ece1725301e06a8abf20ce2177e54747e (patch)
tree8be15d2b808a9849114e83a61f399fdca717bff7
parent0bfa60756ab88c2c1b944e13dc703b16c9aa2ea5 (diff)
signature change
-rw-r--r--build-app.lisp13
-rw-r--r--src/lib.lisp15
2 files changed, 22 insertions, 6 deletions
diff --git a/build-app.lisp b/build-app.lisp
index bfd3dd6..c60da1b 100644
--- a/build-app.lisp
+++ b/build-app.lisp
@@ -62,7 +62,7 @@ my1337pw.")
(flag :long-name "explain"
:description "View oneliner explaination text.")
(enum :long-name "help"
- :enum '(:access :wiki :invites)
+ :enum '(:contributors :wiki :invites)
:argument-name "TOPIC"
:description "Print help for a topic.
Topics: wiki, access, invites"))
@@ -80,14 +80,16 @@ Topics: wiki, access, invites"))
:description "If you have admin priviliges, lock a oneliner from being edited.")
(flag :long-name "unlock"
:description "If you have admin priviliges, unlock a oneliner."))
- (group (:header "Access" :hidden t)
- (text :contents "Options for Managing Access Tokens and Contributor Your Account")
+ (group (:header "Contributors" :hidden t)
+ (text :contents "Options for Managing Your Contributor Account")
(flag :long-name "login"
:description "Attempt to login to your contributor account. ARGS are interpreted as USERNAME PASSWORD.")
(flag :long-name "logout"
:description "Revoke your own access token.")
(flag :long-name "change-password"
- :description "Change your password. ARGS are interpreted as CURRENTPW NEWPW NEWPWAGAIN"))
+ :description "Change your password. ARGS are interpreted as CURRENTPW NEWPW NEWPWAGAIN")
+ (flag :long-name "change-signature"
+ :description "Change your contributor signature. You will be prompted."))
(group (:header "Invites" :hidden t)
(text :contents "Options For Making Invite and Redeeming Tokens")
(flag :long-name "invite"
@@ -132,6 +134,9 @@ than the users."
(destructuring-bind (current new repeated) arguments
(cli::change-pw current new repeated)))
+ ((getopt :long-name "change-signature")
+ (cli:change-signature))
+
((getopt :long-name "invite")
(cli::request-invite-code))
diff --git a/src/lib.lisp b/src/lib.lisp
index 7df571b..713e86b 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -401,10 +401,20 @@ the directories that appear in the value of that variable."
(defun prompt-for-signature ()
- (if (y-or-n-p "Provide a contributor signature about yoruself??")
+ (if (y-or-n-p "Provide a contributor signature about yoruself?")
(prompt "Go ahead: ")
""))
+(defun change-signature ()
+ (let ((new-sig
+ (prompt-for-signature)))
+ (ensure-config)
+ (api:request-with
+ (:host (host)
+ :body (jonathan:to-json (list :signature new-sig)))
+ (api:put--contributor-who-signature (contributor-handle) :token (api-token))
+ (format t "Your signature was changed.~%"))))
+
(defun redeem-invite (token name pass)
(ensure-config )
(when (yes-or-no-p +agree-to-the-unlicense+)
@@ -422,7 +432,8 @@ the directories that appear in the value of that variable."
(ensure-config)
(api:request-with
(:host (host))
- (api:delete--access-access (api-token) :token (api-token))))
+ (api:delete--access-access (api-token) :token (api-token))
+ (format t "You were logged out~%")))
(defun update-history-item (n item)
(when (uiop:file-exists-p (last-search-file))