diff options
author | Johnson Denen <johnson.denen@gmail.com> | 2017-04-11 23:54:33 -0400 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-04-12 18:11:48 -0400 |
commit | 24e038facf1a17d4996a9bca400aa6fe5ebf310b (patch) | |
tree | 8b832d868862f2ad216b3736037b6207ed51b513 /lisp/mastodon-auth.el | |
parent | 82cf1d7faa31c654a2984e9d96b4e8e033694cf6 (diff) |
Add store-client-id-and-secret test
Add `mastodon-auth--token-file' function
Add test for `mastodon-auth--token-file'
Diffstat (limited to 'lisp/mastodon-auth.el')
-rw-r--r-- | lisp/mastodon-auth.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 1892518..bc09403 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -39,6 +39,10 @@ (defvar mastodon--client-app-plist nil) (defvar mastodon--api-token-string nil) +(defun mastodon-auth--token-file () + "Returns `mastodon-token-file' string." + mastodon-token-file) + (defun mastodon-auth--registration-success () (let ((client-data (mastodon--json-hash-table))) (setq mastodon--client-app-plist @@ -70,7 +74,7 @@ STATUS is passed by `url-retrieve'." (defun mastodon--store-client-id-and-secret () "Store `:client_id' and `:client_secret' in a plstore." (let ((client-plist (mastodon--register-and-return-client-app)) - (plstore (plstore-open mastodon-token-file))) + (plstore (plstore-open (mastodon-auth--token-file)))) (plstore-put plstore "mastodon" `(:client_id ,(plist-get client-plist :client_id) :client_secret @@ -86,7 +90,7 @@ If not set, retrieves client data from `mastodon-token-file'. If no data can be found in the token file, registers the app and stores its data via `mastodon--store-client-id-and-secret'." (if (plist-get mastodon--client-app-plist :client_secret) mastodon--client-app-plist - (let* ((plstore (plstore-open mastodon-token-file)) + (let* ((plstore (plstore-open (mastodon-auth--token-file))) (mastodon (plstore-get plstore "mastodon"))) (if mastodon (progn |