Jeff Terrell created an amazing ClojureScript + Auth0 integration, and I wanted to share it with everyone in the community.
The code and README can be found at Jeff Terrell / Auth0 example in Clojurescript and re-frame · GitLab while a deployed site can be found at https://auth0-cljs-re-frame.jeffterrell.tech/
This ClojureScript Spa is designed for simplicity while still maintaining real functionality. It offers more robust error handling and automatic login redirection when going to the /profile path, which will correctly go back to /profile after logging in rather than the root path.
Further features include:
- Authentication implementation contained in a single namespace, with a minimal interface to access Auth0 functionality.
- Protected pages automatically redirect to login page, then back to that page after successful authentication.
- Refresh works on any page.
- User profile data is fetched and displayed, including the Gravatar for the email address.
- Auth errors are caught and displayed. (Try blocking the /token URL in the browser dev tools.)
I hope other members of the community find this useful, and big thank you to Jeff for creating this!