Series Intro
This series will cover the full implementation of OAuth2.0 Authentication in NestJS for the following types of APIs:
And it is divided in 5 parts:
- Configuration and operations;
- Express Local OAuth REST API;
- Fastify Local OAuth REST API;
- Apollo Local OAuth GraphQL API;
- Adding External OAuth Providers to our API;
Lets start the third part of this series.
Tutorial Intro
On this tutorial we will change the adapter from our previous REST API, from Express to Fastify.
TLDR: if you do not have 25 minutes to read the article, the code can be found on this repo
Set Up
Start by removing express and its dependencies:
$ yarn remove @types/express @types/express-serve-static-core @nestjs/platform-express cookie-parser helmet @types/cookie-parser
And install the fastify ones:
$ yarn add @nestjs/platform-fastify fastify @fastify/cookie @fastify/cors...
[gs-fb-comments]