🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

@capsulajs/capsulahub-service-auth

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capsulajs/capsulahub-service-auth

Auth extension allows to use auth0 for authentication logic

latest
npmnpm
Version
0.0.3
Version published
Maintainers
5
Created
Source

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

FAQs

Package last updated on 04 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts