Fastify User Authentication with JWT 👨‍💻 Develop an App from Scratch (Part 4)

preview_player
Показать описание
In this video I will start working on the controllers. I will use Fastify as the HTTP(s) server and router. I start by installing and setting up Fastify. After that I start working on the users controller which will support Create/Read/Update/Delete endpoints and a special login endpoint for JWT authentication. After I setup the CRUD RESTful API endpoints I use @fastify/jwt to setup authentication with json web token. I abstract away the JWT authentication utilities to a seperate plugin which allows me to create a token and make an endpoint inaccessible if a user is not logged in.

Repository:

Contents:
0:00 Introduction
0:22 Changes to the Models Since Last Video
3:13 Setup Fastify
9:01 Create the Users Controller Plugin
15:36 Get a Single User (GET request)
18:12 Create a New User (POST request)
26:49 Modify User Details (PUT request)
30:01 Delete a User (DELETE request)
31:20 Move Types and Schemas to Separate Files
25:23 Create a Login Endpoint
39:04 Setup @fastify/jwt
47:25 Conclusion

Social Media:

#project #application #fastify #jwt #auth
Рекомендации по теме
Комментарии
Автор

This is great. I've come back to Fastify again in recent months and am loving it more than ever! Very happy to see more recent Fastify-related content. Keep up the good work.

dustin
Автор

Amazing tutorial. Very clear, even in the more intricated parts. 👏👏

Devver-
Автор

Thanks for the tutorial, it was great,
what about the refresh tokens process ?

majidaveiro