Liking cljdoc? Tell your friends :D

re-auth0

Clojars Project

re-frame effects for Auth0.

Usage

This sticks relatively close to the structure of Auth0.js v9, which this wraps. See the official docs for reference.

Example

(ns my.app
  (:require [lifecheq/re-auth0.core :as re-auth0]
            ...))

...

(re-frame/reg-event-fx
 :init-web-auth
 (fn [_ _]
   {::re-auth0/init {:client-id config/auth0-client-id
                     :domain    config/auth0-domain}})

)

(re-frame/reg-event-fx
 :login
 (fn [_ _]
   {::re-auth0/authorize {:response-type    "token id_token"
                          :scope            "email app_metadata"
                          :redirect-uri     "https://some.url"
                          :on-authenticated [:new-auth-result]
                          :on-error         [:auth-error]})})

etc.

Significant differences:

  • Use kebab-case for parameters in the options map, instead of CamelCase used in Auth0.js.
  • The Auth0 calls accept a single callback function, which has the signature function(err, authResult). This library specifies two callback vectors, which are given as part of the options map.

License

Copyright © 2018 LifeCheq

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close