aboutsummaryrefslogtreecommitdiff
path: root/sx-auth.el
diff options
context:
space:
mode:
Diffstat (limited to 'sx-auth.el')
-rw-r--r--sx-auth.el23
1 files changed, 13 insertions, 10 deletions
diff --git a/sx-auth.el b/sx-auth.el
index f32e7aa..4ccdd0e 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
@@ -50,15 +50,18 @@ questions)."
(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)