This video will teach you on how to implement JWT for authentication for a react-express app. I Go through two methods of implementation, the first being with cookies where all the logic for access tokens and refresh tokens is handled by the backend. The second method, by sending tokens through JSON and setting it in the local storage and cookies in the frontend.
Github repo for JWT with cookies: https://github.com/Thabish-Kader/jwt-...
Github repo for JWT with JSON: https://github.com/Thabish-Kader/jwt-...
YT for error handling in express APIs : • Handling Errors & Improving the Project Se...
0:00 what we will learn/ demo
02:35 What is jwt ?
03:20 initial code
03:50 express package.json
04:33 initial express code
05:13 Error handling APIs in express
06:51 db and orm config
07:46 Create user (signup controller)
08:42 Setting access token and refresh token in cookies (login controller)
15:23 protected routes with access token (JWTAuth middleware)
16:55 Axios configuration for cookies to work
18:41 Creating custom axios instance
19:05 login and getTweets in react/frontend
19:49 How to refresh the access token with the refresh token?
22:29 Axios config for refresh token
24:55 Second method for JWT access token and refresh token
28:13 end…