Node Auth Tutorial (JWT) #17 - Checking the Current User

  Рет қаралды 49,363

Net Ninja

Net Ninja

Күн бұрын

Пікірлер
@Dinesh-ql1ok
@Dinesh-ql1ok 4 жыл бұрын
Shaun! You are a pure gold man. Although you get more views and likes by uploading random videos on specific topics you are uploading very high quality series all the time. You are a relentless and generous soul :) May you live long with great health. You deserve everyone's RESPECT.
@NetNinja
@NetNinja 4 жыл бұрын
Thank you so much Dinesh :). I appreciate it.
@programmer4047
@programmer4047 4 жыл бұрын
You deserve hundreds of millions of Subscribers
@programmer4047
@programmer4047 3 жыл бұрын
@@laynegianni3423 Don't Try To Scam People. It's fake. These two comments are made by bots
@toberixng
@toberixng 4 жыл бұрын
How could people be this generous, I took your ReactJs crash course and boom building new project. Thanks a million.
@ShashotoANur
@ShashotoANur 4 жыл бұрын
No doubt this is the best node auth tutorial in the world.
@mastersoftware01
@mastersoftware01 4 жыл бұрын
Thank you very much for what you have done. I watch your videos with pleasure.
@dfcw
@dfcw 4 жыл бұрын
Thank you so much, you're the first guy I check if I need to learn anything!
@spaceghost166
@spaceghost166 4 жыл бұрын
Another great series! Thanks for all your efforts!
@ridl27
@ridl27 4 жыл бұрын
I thought my bell is broken or my account was hacked but it was Shaun who decided to like all my comments at once xD ty for this series :)
@NetNinja
@NetNinja 4 жыл бұрын
Haha, I was taking a couple of hours out to try and reply to & like comments :)
@harshsachala21
@harshsachala21 4 жыл бұрын
Well done, i am coding along side as well thank you so much for all your efforts, i am gonna add few tweaks after this series is done!
@practicosbarcelona390
@practicosbarcelona390 4 жыл бұрын
The best teacher I've ever had. Thank you very much !!!
@Daniel-nb3kk
@Daniel-nb3kk 4 жыл бұрын
"That's just bonkers." - Brilliant!
@ComfortHomeMassageChairs
@ComfortHomeMassageChairs Жыл бұрын
Best tutorial i ever seen. i watched many many videos finally found good one.
@Asimz
@Asimz 4 жыл бұрын
Quality instruction as always!
@kelp-chip
@kelp-chip 3 жыл бұрын
Thank you so much, these tutorials are awesome!!! 💖I Was able to tweak all these auth steps to work with a React frontend. The only thing that didn't seem to work in React (for me) was the res.local bit, but I was able to get it working by changing this middleware to a route and sending back the user info that way. All that + useEffect has been working for me for displaying current user info. Hopefully that made sense and could potentially help someone else trying to use React.
@nnevid
@nnevid 2 жыл бұрын
Awesome tutorial! thanks so much, I have a question for all you guys, how did you automatically import the User model in this file? I see the "Auto import from : /models/etc" window at 3:19, but is there a plugin for that, my vscode didn't propose that, i had to import it with the require...thanks :)
@akn9699
@akn9699 4 жыл бұрын
Oh Lord Shaun ! Bless us all with your power of divine invisibility..............
@sleep-404
@sleep-404 3 жыл бұрын
you sure have been sent by some angel to look after us (mere humans)
@mrabodo7a
@mrabodo7a 10 ай бұрын
amazing content! best on the web!
@NetNinja
@NetNinja 10 ай бұрын
Wow, thanks!
@abe10
@abe10 4 жыл бұрын
How many more vids to come on this series Shaun? I was hoping to see all of them together 😅
@NetNinja
@NetNinja 4 жыл бұрын
Only 1 more now :)
@ayoubnachat5920
@ayoubnachat5920 3 жыл бұрын
you helped me a lot thank you so much master
@neznami_clovek
@neznami_clovek 4 жыл бұрын
Hey Shaun, I love your videos! I just wanted to ask, why you used "app.get('*', checkUser)" insed of "app.use(checkUser)". Is there a reason, or is it the same?
@NetNinja
@NetNinja 4 жыл бұрын
Hey, app.use will fire the middleware on all types of requests - POST, PATCH, PUT, DELETE, etc. I ddn't want this - I only wanted to fire the check auth middleware on GET requests for pages.
@mahmoudtareq5782
@mahmoudtareq5782 4 жыл бұрын
the first thing i want to do is to thank you for all this beautiful courses, really i love your way of teaching us the second thing i want to ask is what is the best way when receiving the token. each time if i want the username should i store it in the browser when i login or with each request send it back with the rest of data i need?
@ashG1234
@ashG1234 4 жыл бұрын
Hi how can we use this JWT token in a cookie in a Flutter mobile app? Do we need to use local-storage instead?
@bensonyeboah297
@bensonyeboah297 4 жыл бұрын
Awwwww thanks so much ninja💪
@ibrahimkholil6262
@ibrahimkholil6262 4 жыл бұрын
Hei Shaun! It would be great if you can make a series of next.js. Wating for it for a long time. Please make a series on it soon.
@NetNinja
@NetNinja 4 жыл бұрын
I really want to get around to doing it soon too :)
@VarunSharma-xc9fl
@VarunSharma-xc9fl 4 жыл бұрын
How can I implement and use this middleware sending data in REACT native?
@Akpanmeme2-nl6yc
@Akpanmeme2-nl6yc 3 ай бұрын
Are you british, please I love the way you speak, and pronounce fluently and clearly
@NetNinja
@NetNinja 3 ай бұрын
Yes :) Manchester, England to be precise! thanks for your kind words.
@wordspace121
@wordspace121 5 ай бұрын
I have set res.locals.currentUser = null . But after logout it is showing currentUser as undefined. Anyone with the solution?
@mahmoudfathy7353
@mahmoudfathy7353 2 жыл бұрын
I did the same but I'm facing a problem I get an error that user is not defined
@alamir411
@alamir411 2 жыл бұрын
This was a long way to reach that point
@utkarshgaming8153
@utkarshgaming8153 7 ай бұрын
very good playlist .I used express as a backend and Vue as a frontend.
@g.bagiryan
@g.bagiryan 4 жыл бұрын
Can anyone help? When I log out I can still access the users page by pressing "back" in the browser
@JJ-re5fy
@JJ-re5fy 3 жыл бұрын
In his checkUser function, I don't understand how in line 35 he can call let user = await User.findById(decoded.token); Where is User defined?
@PowerWolf_UA
@PowerWolf_UA 3 жыл бұрын
3:24 User is defined in the top "const User = require('../models/user')"
@luisaugsburger
@luisaugsburger 3 жыл бұрын
I had an error beacuse of this. I fixed importing at the top "const User = require('../models/User');"
@titofrezer6201
@titofrezer6201 2 жыл бұрын
Thank you shaun
@NetNinja
@NetNinja 2 жыл бұрын
No probs Tito!
@denizhbeyaz
@denizhbeyaz 4 жыл бұрын
Can you make a MERN version of this, master?
@ShashotoANur
@ShashotoANur 4 жыл бұрын
Net ninja has the best react tutorial. Check it out. Then replace the frontend of this app with react.
@biswajitbhunia3423
@biswajitbhunia3423 4 жыл бұрын
how many videos are left to complete the series??
@silvenleaf8170
@silvenleaf8170 4 жыл бұрын
One more!! Total 18
@thomasl3205
@thomasl3205 Жыл бұрын
Thank you~😀
@ayushkwal
@ayushkwal 4 жыл бұрын
I stuck on a problem. Can anybody please help me! why I am getting "findById is not a function" error
@nielfollero5
@nielfollero5 3 жыл бұрын
Ha! I got the same error on the previous episodes. Upon checking stackoverflow that doesn't really addressed that problem, I noticed a code snippet that contains, I think ES5 function, that doesn't use arrow function(ES6). Then I checked my code if I was using ES5 function and I saw I was not. Then I remembered master Shawn mentioned that we should use the ES5 function in order to access the 'this' inside our statics function so yeah, use ES5 function instead of arrow function.
@royangagas2519
@royangagas2519 4 жыл бұрын
one episode again this series is end huhuhuhuhu T-T
@hadrienjaubert6273
@hadrienjaubert6273 4 жыл бұрын
Thank you so much for this awesome series ! However after coding the checkUser function I get an errror : 'TypeError: Cannot read property 'jwt' of undefined '. Could you help me please ?
@zael7848
@zael7848 3 жыл бұрын
Same here!
@michealdaniel9655
@michealdaniel9655 2 жыл бұрын
For anyone who is curious, I had the same problem described above. I learned that I mispelled "req.cookies.jwt" as "req.cookie.jwt." Notice the missing 's' after "cookie." Also, I did not import my User model in the top of my authMiddleware.js file. After fixing these issues, my project worked beautifully lol
@martinp.617
@martinp.617 4 жыл бұрын
Salamat..,
@youth1760
@youth1760 4 жыл бұрын
Can you make tut about .NET Core? If you're familiar with
@destinlee
@destinlee 4 жыл бұрын
locals 🤯
@mayursaroj4360
@mayursaroj4360 4 жыл бұрын
@nitinsaxena3082
@nitinsaxena3082 Ай бұрын
👍good !
@martinp.617
@martinp.617 4 жыл бұрын
Salamat..,
Node Auth Tutorial (JWT) #18 - Conditional Rendering
5:01
Net Ninja
Рет қаралды 38 М.
JWT Authentication with Node Crash Course
1:29:11
Laith Academy
Рет қаралды 51 М.
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Managing User Roles - NodeJS Authorization
16:33
PedroTech
Рет қаралды 149 М.
Redis Caching in Node.js
17:42
Traversy Media
Рет қаралды 235 М.
Protect Your API - Next Auth Middleware
8:05
Full Stack Niraj
Рет қаралды 35 М.
Node Auth Tutorial (JWT) #13 - Logging Users in (part 1)
16:22
How To Manage User Roles In Node.js
22:45
Web Dev Simplified
Рет қаралды 314 М.
Build A Node.js API Authentication With JWT Tutorial
1:15:41
developedbyed
Рет қаралды 736 М.
Junior vs Senior React Folder Structure - How To Organize React Projects
16:16