# express-jwt-verify

> middleware for express that verifies jwt token

Latest version **1.0.1** (published 2017-12-15) · 0 weekly downloads

## Install

```sh
npm install express-jwt-verify
pnpm add express-jwt-verify
yarn add express-jwt-verify
bun add express-jwt-verify
```

## 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.0.1 |
| Published | 2017-12-15 |
| First published | 2017-12-15 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | skvist |

## Links

- npm: https://www.npmjs.com/package/express-jwt-verify
- Repository: https://github.com/skvist/express-jwt-verify
- Homepage: https://github.com/skvist/express-jwt-verify#readme
- Issues: https://github.com/skvist/express-jwt-verify/issues
- npm.io page: https://npm.io/package/express-jwt-verify

## Dependencies (1)

- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.1.0

## Recent versions

- 1.0.1 (latest) — 2017-12-15
- 1.0.0 — 2017-12-15

## README

# express-jwt-verify
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/badges/build.png?b=master)](https://scrutinizer-ci.com/g/skvist/express-jwt-verify/build-status/master)

JSON Web Token middleware for expressJS that verifies that the token is valid.

This is mainly a school assignment at Blekinge Institute of Technology.



### Install

```
npm install express-jwt-verify --save
```

### Usage

```
var jwtMiddleware = require('express-jwt-verify');

var protectedRoutes = express.Router();

app.use('/protected', protectedRoutes);

protectedRoutes.use(jwtMiddleware('mysecret'));

protectedRoutes.get('/decoded', function(req, res) {
    res.json(req.decoded);
});
```
If the verification succeeds it will the pass decoded token with the request (req.decoded) and if it fails it sends a HTTP 403 status and a JSON-body with information.


Theese options can be passed to the verify function:

https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback

```
var jwtMiddleware = require('express-jwt-verify');

protectedRoutes.use(jwtMiddleware('mysecret' , { maxAge: 1000 }));

```

---
_Source: https://npm.io/package/express-jwt-verify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
