aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-28 08:35:15 -0600
committerColin Okay <okay@toyful.space>2022-02-28 08:35:15 -0600
commit30b5f65fd5c89dda8081058ab62da5e1d78335fe (patch)
treea7f06a13ecfd4fe00d609f84df5536466e10b3f2
parent4a8a81671aad1163b425438b18d676b42112109d (diff)
signatures added to account creation via token redeeming
-rw-r--r--build-app.lisp2
-rw-r--r--src/lib.lisp9
2 files changed, 9 insertions, 2 deletions
diff --git a/build-app.lisp b/build-app.lisp
index 5995439..793ffae 100644
--- a/build-app.lisp
+++ b/build-app.lisp
@@ -19,7 +19,7 @@ redeeming invite tokens.
When the --redeem option is passed, the ARGS section is expected to be
three items long, and is interpreted as TOKEN USERNAME PASSWORD. E.g.:
- ol --redeem PHONEYTOKEN c00lhacker my1337pw
+ ol --redeem PHONEYTOKEN c00lhacker my1337pw
Would attempt to make a new user named c00lhacker with password
my1337pw.")
diff --git a/src/lib.lisp b/src/lib.lisp
index 58d071c..8dbbbc9 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -366,12 +366,19 @@ the directories that appear in the value of that variable."
contributions using The Unlicense. (see https://unlicense.org/)")
+(defun prompt-for-signature ()
+ (if (y-or-n-p "Provide a contributor signature about yoruself??")
+ (prompt "Go ahead: ")
+ ""))
+
(defun redeem-invite (token name pass)
(ensure-config )
(when (yes-or-no-p +agree-to-the-unlicense+)
(api:request-with
(:host (host)
- :body (jonathan:to-json (list :handle name :password1 pass :password2 pass))
+ :body (jonathan:to-json (list :handle name
+ :password1 pass :password2 pass
+ :signature (prompt-for-signature)))
:content-type "application/json")
(api:post--invite-redeem-code token)
(format t "Account made for ~a. You may log in now~%" name))))