In action

Within the Echo project, there is a directory called middleware, which contains many contributed middleware solutions seen here: https://github.com/labstack/echo/tree/master/middleware. These middleware functions have been vetted by the community, and follow the middleware best practices guidelines. In this section, we will dissect one very useful middleware, and show how to use these middleware in our example application.

We will start by looking at middleware.JWT, which is a very helpful middleware that takes a JSON Web Token (JWT) from the request header specified by the developer and validates that the token is legitimate. In our example, the handlers.Login handler will validate the user credentials with bcrypt, and after that ...

Get Echo Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.