aboutsummaryrefslogtreecommitdiff
path: root/sx-auth.el
diff options
context:
space:
mode:
authorSean Allred <code@seanallred.com>2014-11-18 23:49:07 -0500
committerSean Allred <code@seanallred.com>2014-11-19 00:00:42 -0500
commit0dd95e3a3d4ee52f52a585388c3ba65e045c305b (patch)
treef8c4497519cf6f741ea7ec379c537f4b71a4de88 /sx-auth.el
parent20dd7254da8e95bd01ce57f806733dee20005039 (diff)
parent681319aeb250a83d982d1e3e02264a7af0ae4120 (diff)
Merge branch 'master' into documentation
Conflicts: sx-method.el sx-question-list.el sx-question-mode.el sx-question.el sx-request.el sx.el
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)