diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-23 01:14:18 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-23 11:09:06 -0400 |
commit | 993fbec64edf128ba9e5a1aa61f93c385fe3be31 (patch) | |
tree | 02ebed1a77f3e7e4e3893d3ddf335bb3aac6358b /lisp | |
parent | 950a71a7e89efe48804a89322f9a974610d40770 (diff) |
Clean up tests and update DOCSTRINGs
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-auth.el | 9 |
1 files changed, 6 insertions, 3 deletions
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)) |