aboutsummaryrefslogtreecommitdiff
path: root/sx-auth.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-auth.el')
-rw-r--r--sx-auth.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/sx-auth.el b/sx-auth.el
index 96523f6..4299f37 100644
--- a/sx-auth.el
+++ b/sx-auth.el
@@ -28,7 +28,7 @@
(require 'sx-cache)
(defconst sx-auth-root
- "https://stackexchange.com/oauth/")
+ "https://stackexchange.com/oauth/dialog")
(defconst sx-auth-redirect-uri
"http://vermiculus.github.io/stack-mode/auth/auth.htm")
(defconst sx-auth-client-id
@@ -69,15 +69,17 @@ parsed and displayed prominently on the page)."
(interactive)
(setq
sx-auth-access-token
- (let ((url (sx-request-build
- "dialog"
- `((client_id . ,sx-auth-client-id)
- (scope . (read_inbox
- no_expiry
- write_access))
- (redirect_uri . ,(url-hexify-string
- sx-auth-redirect-uri)))
- "," sx-auth-root)))
+ (let ((url (concat
+ sx-auth-root
+ "?"
+ (sx-request--build-keyword-arguments
+ `((client_id . ,sx-auth-client-id)
+ (scope . (read_inbox
+ no_expiry
+ write_access))
+ (redirect_uri . ,(url-hexify-string
+ sx-auth-redirect-uri)))
+ ","))))
(browse-url url)
(read-string "Enter the access token displayed on the webpage: ")))
(if (string-equal "" sx-auth-access-token)