Skip to content

Commit

Permalink
Fixes bug when merging state-map. Also fixes not creating a token ref…
Browse files Browse the repository at this point in the history
…resh thread when token is forever.
  • Loading branch information
blmstrm committed Mar 26, 2016
1 parent e88373f commit 6b9b501
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/loudmoauth/authflow.clj
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@
[provider-auth-data]
(when-let [token-refresher (:token-refresher provider-auth-data)]
(future-cancel token-refresher))
(when-let [expiry-time (:expires_in provider-auth-data)]
(assoc provider-auth-data :token-refresher (token-refresher expiry-time))))
(if-let [expiry-time (:expires_in provider-auth-data)]
(assoc provider-auth-data :token-refresher (token-refresher expiry-time))
provider-auth-data))

;TODO If oauth-token is not set, do the initial call. If it is already set do a refresh call.
; By doing it this way we don't have to distinguish between grant_type outside get-tokens.
Expand Down
1 change: 0 additions & 1 deletion src/loudmoauth/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
(lma/add-response-type "code" params)
params)
(lma/add-state)
(merge old-app-state)
(swap! lma/app-state assoc provider))))

;Here we either supply our key or don't. If no key, just return (first tokens)
Expand Down

0 comments on commit 6b9b501

Please sign in to comment.