New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@clevertech.biz/auth-core

Package Overview
Dependencies
Maintainers
4
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clevertech.biz/auth-core

The set of utilities necessary to build an authentication service. This does not include templates, views, styles, or transport layer.

3.0.1
Source
npm
Version published
Maintainers
4
Created
Source

CleverAuth Core

Generic auth library for Clevertech.

Testing

You have to run the tests with node v10 or v12. Node v14 has a known issue with older pg clients.

docker-compose -f test/docker-compose.yml up -d
npm run test

Example

import {
  Core,
  KnexAdapter,
  MongoAdapter,
  DefaultEmailService,
  Crypto,
  JWT,
  Validations,
  TwilioSMSService
} from '@clevertech.biz/auth-core'

const db = new MongoAdapter('<uri>')
const db = new KnexAdapter({
  // knex config here
})
const sms = new TwilioSMSService(
  '<accountSid>',
  '<authToken>',
  '<numberFrom>'
})

const core = new Core({
  projectName: '<projectName>',
  db,
  email: new DefaultEmailService({
    projectName: '',
    confirmEmailURL: '',
    requestResetPasswordURL: '',
    resetPasswordURL: '',
    emailServiceConfig: {
      // config for pnp-email-service
    }
  }),
  crypto: new Crypto('<key>', '<algorithm> = aes-256-gcm'),
  jwt: new JWT('<algorithm>', '<secretOrPrivateKey>', '<secretOrPublicKey>', {
    // default options: see https://github.com/auth0/node-jsonwebtoken#usage
  }),
  validations: new Validations(['name', 'company'], true),
  sms,
  numberOfRecoverCodes: 10
})

FAQs

Package last updated on 04 Feb 2021

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