https://github.com/lifecheq/re-auth0
re-frame effects for auth0
https://github.com/lifecheq/re-auth0
auth0 re-frame
Last synced: 3 months ago
JSON representation
re-frame effects for auth0
- Host: GitHub
- URL: https://github.com/lifecheq/re-auth0
- Owner: lifecheq
- License: epl-1.0
- Archived: true
- Created: 2018-02-26T19:34:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-03-13T11:09:27.000Z (almost 6 years ago)
- Last Synced: 2025-09-14T22:58:49.598Z (4 months ago)
- Topics: auth0, re-frame
- Language: Clojure
- Size: 24.4 KB
- Stars: 7
- Watchers: 15
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# re-auth0
[](https://clojars.org/lifecheq/re-auth0)
[re-frame](https://github.com/Day8/re-frame) effects for [Auth0](https://auth0.com/docs/libraries).
## Usage
This sticks relatively close to the structure of [Auth0.js v9](https://github.com/auth0/auth0.js),
which this wraps. See the [official docs](https://auth0.com/docs/libraries/auth0js/v9) for reference.
Example
```clj
(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.