simple-auth0
v0.0.4
Published
Simple wrapper around auth0 SDK
Downloads
5
Readme
simple-auth0
Wrapper around the [auth0-js] and [auth0-lock] libraries to provide a simple authentication package reusable across applications.
Usage
Install via npm:
npm install --save simple-auth0
Use with this trial code:
import createAuth0Client from "simple-auth0";
const auth0 = createAuth0Client({
clientID: "",
domain: "",
audience: "",
assembleUser: (profile, accessToken) => {
return {
name: profile.name,
accessToken
}
},
lockTheme: {
logo: "",
primaryColor: "#000000",
backgroundColor: "#000000"
},
lockTitle: "My Application"
});
auth0
.currentUser()
.then(({ user }) => {
// sample logic
if (user) {
// redirect to login screen
} else {
// start authenticated app
}
})