6.1.0 • Published 2 years ago

@clevertech.biz/auth-core v6.1.0

Weekly downloads
92
License
MIT
Repository
github
Last release
2 years ago

CleverAuth Core

Generic auth library for Clevertech.

Testing

You have to run the tests with node v10 or newer 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
})
6.1.0

2 years ago

6.0.0

2 years ago

5.0.0

2 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

2.0.0-beta.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

7 years ago