MERN Stack Authentication with JWT Access, Refresh Tokens, Cookies

preview_player
Показать описание

Learn MERN Stack Authentication and Authorization with JWT Access & Refresh Tokens and secure cookies. Create auth routes and an auth controller for a REST API that will handle authentication and issue JWT tokens for valid users.

⭐ Become a full-stack web dev with Zero To Mastery Courses:

👇 Follow Me On Social Media:

MERN Stack Authentication with JWT Access, Refresh Tokens, Cookies

(00:00) Intro
(00:09) Welcome
(00:22) Quick lessons recap
(00:55) Authentication vs Authorization
(01:49) Starter Code
(02:12) Add auth routes to server
(02:42) Auth routes router
(04:26) Rate limiting middleware
(07:47) Auth controller
(10:07) Adding controller methods to auth routes
(11:01) Understanding the JWT auth process
(15:34) login method in auth controller
(20:13) refresh method in auth controller
(22:31) logout method in auth controller
(23:29) Create middleware to verify JWTs
(26:51) Apply verifyJWT middleware to routes
(28:44) Test the login endpoint with Postman
(31:23) Test the refresh endpoint with Postman
(32:33) Test the logout endpoint with Postman
(33:15) Test the verifyJWT middleware with Postman

📚 Suggested Pre-requisites for this MERN course:

📚 Tutorial References:

Was this MERN Stack Authentication tutorial helpful? If so, please share. Let me know your thoughts in the comments.

#mern #stack #authentication
Рекомендации по теме
Комментарии
Автор

The layout of this tutorial and lesson 1-4 on how routes, controller and middleware are put together is amazing. I have gone through the the nodejs tutorial suggested too. That was a big help. But thanks to this one, the concepts are so crisp and clear. Thank you for doing these tutorials. Keep posting!

msurabhi
Автор

The video was unbelievably helpful. Thank you so much.

rjwhite
Автор

Thanks Dave! All working correctly and up to date. Looking forward to continuing this project with you! Many thanks, Sai

sailee
Автор

Thanks for the great content. Keep it up ❤

CKNMEDIA
Автор

Thanks Dave for the great content, always delivering the goods 😎

alielb
Автор

After or before developing any site, every developer fear about the sites security. At least backend developer. You teach us a lot about security. Its a big issue that how and when to logged any vulnerable users info. Keep it up and thank you.

mrbilchalan
Автор

Thanks a lot Dave for all the efforts you are putting for us.

saketparasher
Автор

I'm so happy I stumbled upon your channel!

medusa
Автор

Thank you very much, you helped me a lot ^^

diasihammouten
Автор

it maybe the must important video in this playlist.

ALi-Sloom
Автор

This is probably one of the most useful videos that I have watched in programming journey. Dan, you're such a great teacher !

dnguyendev
Автор

Great tutorial Dave! Can't wait for the front-end implementation with Redux. It's the most confusing part for me :)

jozefb.
Автор

Very useful. I'm a backend developer working on a hobby full stack project with React and I'm using local storage for the token on my frontend which I know it's a bad practice but it was the one that worked when I started this many months ago. 😅

leoMC
Автор

Wow, you went above and beyond on this one by showing how to create secure secrets for the tokens! Almost everyone skips that! Thank you! Can't wait for the next part! Would be more than happy to buy any paid course from you in the future if you make one someday!

codernerd
Автор

Thanks for the tutorial a lot. I couldn't get why we did not give refresh token too after login to the user but only accessToken.

morgalaksi
Автор

Hi there, Dave! Thanks for your tutorials, they are awesome! I have a question, when you logout, but you haven't refreshed it, you can't go to '/', there's an error in here, how can I resolve it?

lalojejeje
Автор

JWT didn't really make sense in the node js course, because I had not watched the react auth course but now that I have watched it and I have seen this video all the things that didn't make sense are starting to addup, thank you soo mush for your continuous efforts

abdulrahmanagboolaosho
Автор

please make some videos to regard with design patterns and how to use them in both front end and backend, thanks for your contents

shayanhdry
Автор

Hi Dave! thanks for sharing such resourceful materials!
I've seen videos on JWT authentication in both node JS and MERN stack playlist but I'm not quite sure if I got the whole concept.
I googled it and read some articles but I'm not quite sure if I digested the concept properly. Do you have any tutorial on the flowchart of this processes?

pj
Автор

Thanks Dave for the tutorial. I have a question. In the accessToken validation middleware, wouldn't it be good to check if the refreshToken is in the cookie?

dav.R