diff options
author | Abhiseck Paira <abhiseckpaira@disroot.org> | 2022-01-13 20:22:48 +0530 |
---|---|---|
committer | Abhiseck Paira <abhiseckpaira@disroot.org> | 2022-01-13 20:22:48 +0530 |
commit | e18a2d541fca4c5f08f35d1de72d3a3ee9cfe011 (patch) | |
tree | 5dbabfcfb33fe7f40af1e6c1a06841daf9df3dea /lisp/mastodon-auth.el | |
parent | 9ca02d048fdb70c1edec189ddf87265dfb4c80b2 (diff) |
remove functions no longer needed
Remove `mastodon-auth--generate-token-no-storing-credentials' and
'mastodon-auth--generate-token-and-store' as these two are no longer
needed.
Diffstat (limited to 'lisp/mastodon-auth.el')
-rw-r--r-- | lisp/mastodon-auth.el | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 8a058f3..55db0c0 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -87,49 +87,6 @@ if you are happy with unencryped storage use e.g. \"~/authinfo\"." authorization-code)) (defun mastodon-auth--generate-token () - -(defun mastodon-auth--generate-token-no-storing-credentials () - "Make POST to generate auth token, without using auth-sources file." - (mastodon-http--post - (concat mastodon-instance-url "/oauth/token") - `(("client_id" . ,(plist-get (mastodon-client) :client_id)) - ("client_secret" . ,(plist-get (mastodon-client) :client_secret)) - ("grant_type" . "password") - ("username" . ,(read-string "Email: " user-mail-address)) - ("password" . ,(read-passwd "Password: ")) - ("scope" . "read write follow")) - nil - :unauthenticated)) - -(defun mastodon-auth--generate-token-and-store () - "Make POST to generate auth token. - -Reads and/or stores secrets in `MASTODON-AUTH-SOURCE-FILE'." - (let* ((auth-sources (list mastodon-auth-source-file)) - (auth-source-creation-prompts - '((user . "Enter email for %h: ") - (secret . "Password: "))) - (credentials-plist (nth 0 (auth-source-search - :create t - :host mastodon-instance-url - :port 443 - :require '(:user :secret))))) - (prog1 - (mastodon-http--post - (concat mastodon-instance-url "/oauth/token") - `(("client_id" . ,(plist-get (mastodon-client) :client_id)) - ("client_secret" . ,(plist-get (mastodon-client) :client_secret)) - ("grant_type" . "password") - ("username" . ,(plist-get credentials-plist :user)) - ("password" . ,(let ((secret (plist-get credentials-plist :secret))) - (if (functionp secret) - (funcall secret) - secret))) - ("scope" . "read write follow")) - nil - :unauthenticated) - (when (functionp (plist-get credentials-plist :save-function)) - (funcall (plist-get credentials-plist :save-function)))))) "Generate access_token for the user. Return response buffer." (let ((authorization-code (mastodon-auth--ask-authorization-code))) (mastodon-http--post |