aboutsummaryrefslogtreecommitdiff
path: root/src/lib.lisp
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-18 18:51:47 -0600
committerColin Okay <okay@toyful.space>2022-02-18 18:51:47 -0600
commitc2475ad2a120f67a2dd373d1e720e4dac77d1d7e (patch)
tree8d063a1bb94b1c79cd68d3f7e222047e5366761b /src/lib.lisp
parent13d628d008584dff9465a9fb48e4e57e74bf7643 (diff)
added paramater token to api client functions
Diffstat (limited to 'src/lib.lisp')
-rw-r--r--src/lib.lisp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/lib.lisp b/src/lib.lisp
index a54cf7f..0ae2b8b 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -63,27 +63,14 @@
(when (uiop:file-exists-p (last-search-file))
(nth n (uiop:read-file-form (last-search-file)))))
-(defun make-cookie-from-api-token ()
- (a:when-let (token (api-token))
- (let ((cookies (cl-cookie:make-cookie-jar)))
- (cl-cookie:merge-cookies
- cookies
- (list
- (cl-cookie:make-cookie
- :name "olauthtoken"
- :value token
- :path "/"
- :domain "localhost")))
- cookies)))
-
;;; API REQUEST FUNCTIONS
(defun request-invite-code ()
(ensure-config)
(api:request-with
- (:host (host)
- :cookies (make-cookie-from-api-token))
- (format t "Invite Code: ~a~%" (getf (jonathan:parse (api:post--make-invite)) :code))))
+ (:host (host))
+ (format t "Invite Code: ~a~%"
+ (getf (jonathan:parse (api:post--make-invite :token (api-token))) :code))))
(defun login (user pass)
(ensure-config)