0.4.0 • Published 6 years ago

trek-jwt v0.4.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

trek-jwt

JSON Web Tokens Middleware for Trek.js

Installation

$ npm install trek-jwt --save

Examples

'use strict'

const Engine = require('trek-engine')
const jwt = require('..')

async function start () {
  const app = new Engine()
  const secret = 'Trek Engine'

  app.use(jwt({ secret }))

  app.use(({ req, res }) => {
    res.body = req.body
  })

  app.on('error', (err, ctx) => {
    console.log(err)
  })

  app.run(3000)
}

start().catch(err => console.log(err))

API

const defaults = {
  key: 'user',
  secret: undefined,
  skip: false,
  tokenLookup: 'header:Authorization',
  authScheme: 'Bearer',
  verifyOptions: undefined,
  passthrough: false
}

Badges

Build Status codecov npm.io


fundon.me  ·  GitHub @fundon  ·  Twitter @_fundon

0.4.0

6 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago