Strange Mist behaviour workaround
This commit is contained in:
parent
2f6a835bba
commit
4a009a09e8
|
@ -26,10 +26,9 @@
|
||||||
(let [resp (github/post-for-token code state)
|
(let [resp (github/post-for-token code state)
|
||||||
body (keywordize-keys (codec/form-decode (:body resp)))
|
body (keywordize-keys (codec/form-decode (:body resp)))
|
||||||
access-token (:access_token body)]
|
access-token (:access_token body)]
|
||||||
(if-let [error (:error body)]
|
(if (:error body)
|
||||||
(:body
|
;; Why does Mist browser sends two redirects at the same time? The latter results in 401 error.
|
||||||
(error-page {:status 401
|
(response/redirect "/")
|
||||||
:title error}))
|
|
||||||
(let [user (get-or-create-user access-token)]
|
(let [user (get-or-create-user access-token)]
|
||||||
(-> (response/redirect "/")
|
(-> (response/redirect "/")
|
||||||
(assoc :session {:identity user})))))))
|
(assoc :session {:identity user})))))))
|
||||||
|
|
Loading…
Reference in New Issue