Skip to content

Commit

Permalink
Merge pull request #8 from bombaywalla/use-form-params
Browse files Browse the repository at this point in the history
Use form-params instead of JSON body.
  • Loading branch information
timothypratley authored Oct 25, 2024
2 parents 6840301 + 6dee5d3 commit da91e45
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/happyapi/oauth2/auth.clj
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@
;; but accepts them in the Basic Auth header (undocumented).
;; Other providers require them as Basic Auth header.
:headers {"Authorization" (str "Basic " (base64 (str client_id ":" client_secret)))}
;; params can be sent as form-params or json body
:body (cond-> {:code code
:form-params (cond-> {:code code
:grant_type "authorization_code"
:redirect_uri redirect_uri}
code_verifier (assoc :code_verifier code_verifier))
Expand Down Expand Up @@ -112,8 +111,7 @@
{:id ::refresh-missing-token})))
resp (request {:url token_uri
:method :post
;; may be form-params or json body
:body params
:form-params params
:keywordize-keys true})]
(when (middleware/success? resp)
(with-timestamp (:body resp))))
Expand Down

0 comments on commit da91e45

Please sign in to comment.