Skip to content

Instantly share code, notes, and snippets.

@qleguennec
Created September 7, 2017 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save qleguennec/e7a8102f5fd1e5225b48b68c3c81918b to your computer and use it in GitHub Desktop.
Save qleguennec/e7a8102f5fd1e5225b48b68c3c81918b to your computer and use it in GitHub Desktop.
(rf/reg-event-fx
:auth
(fn [{:keys [db]} _]
{:POST
{:url "https://api.intra.42.fr/oauth/token"
:on-success #(assoc db :token (:access_token %))
:on-fail :auth-nok
:params
{:grant_type "client_credentials"
:client_id "secret"
:client_secret "secret"}}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment