0.0.3 • Published 4 years ago
@capsulajs/capsulahub-service-auth v0.0.3
Auth service
The purpose of this service is to provide a utility tool that allows user to implement authentication logic using auth0 service.
Take a look at Lock.js documentation in order to get the whole list of lockOptions.
Usage
// You should call init as soon as possible in order to get the current auth status of a user
// If you call login method before init, login popup will not be shown until init resolves
authService.init({}).then((authStatusDataAfterInit) => {
if (!authStatusDataAfterInit.token) {
return authStatusDataAfterInit.login({}).then((authStatusDataAfterLogin) => {
console.info(authStatusDataAfterLogin);
})
}
});
Install
NPM
To install the package from NPM registry you should run
yarn add @capsulajs/capsulahub-service-auth
or
npm install @capsulajs/capsulahub-service-auth
CDN
You can get the default export from the link
https://capsulajs.s3.amazonaws.com/develop/capsulahub-service-auth/index.js
WorkspaceConfiguration example
{
"services": [
{
"serviceName": "AuthService",
"path": "https://capsulajs.s3.amazonaws.com/develop/capsulahub-service-auth/index.js",
"definition": {
"serviceName": "AuthService",
"methods": {
"init": { "asyncModel": "requestResponse" },
"login": { "asyncModel": "requestResponse" },
"logout": { "asyncModel": "requestResponse" },
"authStatus$": { "asyncModel": "requestStream" }
}
},
"config": {
"serviceName": "AuthService",
"domain": "dev-f8nw441q.auth0.com",
"clientId": "RS6FSurmbVq9B31sJ57Px4NZpcdyCnHQ"
}
}
]
}
Exports
Default
Bootstrap function of the extension.
Named (API)
The public API of the extension.
API
CDN
The documentation about public API.
Local
Run
yarn doc
And open doc/index.html in browser.
Test
npm run test
or yarn test
Licence
CapsulaHub and related services are released under MIT Licence.
Back to the Main Page
0.0.4-next.100
4 years ago
0.0.3
4 years ago
0.0.2-next.105
4 years ago
0.0.2-alpha.1575380902.111
4 years ago
0.0.2
4 years ago
0.0.2-next.109
4 years ago
0.0.2-next.115
4 years ago
0.0.2-alpha.1572619696.145
5 years ago
0.0.2-alpha.1572618123.143
5 years ago
0.0.2-alpha.1572615468.141
5 years ago
0.0.2-alpha.1572613534.140
5 years ago
0.0.1
5 years ago