stearm / micro-jwt-auth

jwt authorization wrapper for zeit/micro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

micro-jwt-auth

jwt authorization wrapper for Micro

An Authorization header with value Bearer MY_TOKEN_HERE is expected

example

'use strict'

const jwtAuth = require('micro-jwt-auth')

/*
    if Authorization Bearer is not present or not valid, return 401
*/

module.exports = jwtAuth('my_jwt_secret')(async(req, res) => {
  return "Ciaone!"
})

About

jwt authorization wrapper for zeit/micro

License:MIT License


Languages

Language:JavaScript 100.0%