Skip to content

Commit

Permalink
remove travis badge
Browse files Browse the repository at this point in the history
  • Loading branch information
jfromaniello committed Apr 20, 2022
1 parent 8d7af26 commit a854342
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# express-jwt

[![Build](https://travis-ci.org/auth0/express-jwt.png)](http://travis-ci.org/auth0/express-jwt)

This module provides Express middleware for validating JWTs ([JSON Web Tokens](https://jwt.io)) through the [jsonwebtoken](https://github.com/auth0/node-jsonwebtoken/) module. The decoded JWT payload is available on the request object.

## Install
Expand Down Expand Up @@ -74,7 +72,7 @@ jwt({
To only protect specific paths (e.g. beginning with `/api`), use [express router](https://expressjs.com/en/4x/api.html#app.use) call `use`, like so:

```javascript
app.use('/api', jwt({ secret: 'shhhhhhared-secret', algorithms: ['HS256']}));
app.use("/api", jwt({ secret: "shhhhhhared-secret", algorithms: ["HS256"] }));
```

Or, the other way around, if you want to make some paths unprotected, cal `unless` like so.
Expand Down Expand Up @@ -206,8 +204,8 @@ The default behavior is to throw an error when the token is invalid, so you can

```javascript
app.use(function (err, req, res, next) {
if (err.name === 'UnauthorizedError') {
res.status(401).send('invalid token...');
if (err.name === "UnauthorizedError") {
res.status(401).send("invalid token...");
} else {
next(err);
}
Expand Down

0 comments on commit a854342

Please sign in to comment.