From 993fbec64edf128ba9e5a1aa61f93c385fe3be31 Mon Sep 17 00:00:00 2001 From: Johnson Denen Date: Sun, 23 Apr 2017 01:14:18 -0400 Subject: Clean up tests and update DOCSTRINGs --- lisp/mastodon-auth.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-auth.el') diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 09813d3..a608dbe 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -36,10 +36,10 @@ :group 'mastodon) (defvar mastodon-auth--token nil - "") + "User access token.") (defun mastodon-auth--generate-token () - "" + "Make POST to generate auth token." (mastodon-http--post (concat mastodon-instance-url "/oauth/token") `(("client_id" . ,(plist-get (mastodon-client) :client_id)) @@ -51,7 +51,7 @@ nil)) (defun mastodon-auth--get-token () - "" + "Make auth token request and return JSON response." (with-current-buffer (mastodon-auth--generate-token) (goto-char (point-min)) (re-search-forward "^$" nil 'move) @@ -62,6 +62,9 @@ (json-read-from-string json-string)))) (defun mastodon-auth--access-token () + "Return `mastodon-auth--token'. + +Generate token and set `mastodon-auth--token' if nil." (or mastodon-auth--token (progn (let* ((json (mastodon-auth--get-token)) -- cgit v1.2.3