# @remap/authenticate-middleware

> ReMap Authenticate Middleware

Latest version **1.1.1** (published 2018-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install @remap/authenticate-middleware
pnpm add @remap/authenticate-middleware
yarn add @remap/authenticate-middleware
bun add @remap/authenticate-middleware
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2018-09-30 |
| First published | 2018-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.6.0 |
| Dependencies | 2 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Shingo Sato |
| Maintainers | remap-admin, sugarshin |

## Links

- npm: https://www.npmjs.com/package/@remap/authenticate-middleware
- Repository: https://github.com/remap-app/authenticate-middleware
- Homepage: https://github.com/remap-app/authenticate-middleware#readme
- Issues: https://github.com/remap-app/authenticate-middleware/issues
- npm.io page: https://npm.io/package/@remap/authenticate-middleware

## Dependencies (2)

- [micro-errors](https://npm.io/package/micro-errors.md) ^2.0.0
- [@remap/services](https://npm.io/package/@remap/services.md) ^2.0.0

## Recent versions

- 1.1.1 (latest) — 2018-09-30
- 1.1.0 — 2018-09-25
- 1.0.2 — 2018-09-10
- 1.0.1 — 2018-09-10
- 1.0.0 — 2018-09-10

## README

# authenticate-middleware

[![CircleCI](https://circleci.com/gh/remap-app/authenticate-middleware.svg?style=svg&circle-token=e081049555083cdc0703ef912dd7c933c5b74ab6)](https://circleci.com/gh/remap-app/authenticate-middleware)

```sh
yarn add @remap/authenticate-middleware
```

## Usage

```js
const compose = require('micro-compose')
const { handleErrors } = require('micro-errors')
const authenticateMiddleware = require('@remap/authenticate-middleware')

module.exports = compose(
  handleErrors(),
  authenticateMiddleware(),
)(
  async (req, res) => {
    // req.auth
    // {
    //   name: string;
    //   picture: string;
    //   auth_time: number;
    //   email: string;
    //   email_verified: boolean;
    //   uid: string;
    // }
  }
)
```

### Optional custom authenticator

```js
const middleware = authenticateMiddleware({
  authenticate: async () => await doSomething(),
})
```

---
_Source: https://npm.io/package/@remap/authenticate-middleware · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
