June 2025
Intermediate to advanced
837 pages
24h 50m
English
For authentication, Nest uses an established library—Passport—and integrates it into the framework via an abstraction layer. The flexibility of Passport allows you to implement different logon strategies. In our case, we use JSON web tokens (JWTs).
First you need to install some additional packages via the npm install @nestjs/passport passport @nestjs/jwt passport-jwt command. In addition, you must install the type definitions of passport-jwt as DevDependency via the npm install --save-dev @types/passport-jwt command.
Theoretically, you can store your users’ credentials permanently in the source code, but because there’s already an existing database connection, it makes sense to use this database to store ...
Read now
Unlock full access