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 theoptions
map, instead ofCamelCase
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 theoptions
map.
Copyright © 2018 LifeCheq
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.