@moreillon/express_identification_middleware
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

Express identification middleware

An expres middlewware to identify users from their HTTP requests.

Usage

import express from "express"
import auth from "@moreillon/express_identification_middleware"

const app = express()
const authOptions = { url: `https://api.users.maximemoreillon.com/users/self` }

app.use(auth(options))

app.listen(8080, () => {
  console.log(`Express server started`)
})

Options

  • url: The URL of the identification route of the authentication API
  • lax: Boolean, set to true to allow unidentified users

Readme

Keywords

none

Package Sidebar

Install

npm i @moreillon/express_identification_middleware

Weekly Downloads

6

Version

1.4.0

License

MIT

Unpacked Size

18.1 kB

Total Files

10

Last publish

Collaborators

  • moreillon