@apikee/authenticator-mongostore
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@apikee/authenticator-mongostore

MongoDB Store for @apikee/authenticator

It uses mongoose under the hood

Installation

npm i @apikee/authenticator-mongostore

Usage

import { Authenticator } from '@apikee/authenticator';
import { MongoStore, ConnectOptions } from '@apikee/authenticator-mongostore';

const mongooseConnectOptions: ConnectOptions = {};

const { createAccess, validateAccess, refreshAccess, revokeAccess } = new Authenticator({
  accessKey: "verySecretAccessKeyPleaseChangeMeOrUseDotenv", // Never commit your secrets to public repo
  refreshKey: "verySecretRefreshKeyPleaseChangeMeOrUseDotenv", // Never commit your secrets to public repo
  store: new MongoStore("mongodb://localhost:27017/DB_NAME", mongooseConnectOptions, () => {
    console.log("DB Connected")
  })
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @apikee/authenticator-mongostore

Weekly Downloads

0

Version

0.0.2

License

none

Unpacked Size

12.3 kB

Total Files

21

Last publish

Collaborators

  • apikee