How to create Protected Routes and Authentication with React Router V6 2023

  Рет қаралды 76,359

Kodie

Kodie

Күн бұрын

Пікірлер: 96
@vPopovPHX
@vPopovPHX 11 ай бұрын
This video is just pure gold! Straightforward, concise, without any useless information. Amazing!
@kodieCode
@kodieCode 10 ай бұрын
Glad you enjoyed it!
@samontefrankamirsong.5474
@samontefrankamirsong.5474 10 ай бұрын
You deserved more subscribers. You are a good example on what the developers should follow. I haven't followed yours but I created something that is similar and in tsx.
@kodieCode
@kodieCode 10 ай бұрын
I appreciate that!
@destinyforeveryone3659
@destinyforeveryone3659 5 ай бұрын
This video was exactly what I needed!! I've been confused with authentication and the bunch of different ways to do it and a video that cuts all the extra stuff and shows you the basics of how it works was perfect. Thanks so much, hope you make more videos was sad to see this was your latest on in a year.
@kodieCode
@kodieCode 3 ай бұрын
thanks for the comment. More coming in October now I have more time
@meirstroh
@meirstroh 24 күн бұрын
Finally someone who doesn’t code in the video just explains the code
@theonlymaster9374
@theonlymaster9374 5 ай бұрын
This is a super useful video!!!, went through it, understood how everything is done, great video!!!
@kodieCode
@kodieCode 3 ай бұрын
Thanks for the comment.
@DankoKralski
@DankoKralski Жыл бұрын
Amazing video! I love how there are people like you that go straight to the point and explain in plain English. Thanks a lot for the video! PS: Better teaching methods than my university (will definitely suggest to my friends)!
@kodieCode
@kodieCode 11 ай бұрын
Really appreciate the feedback!
@AIwithChinmay
@AIwithChinmay 6 ай бұрын
straight and easy to understand thanks for the video.
@kodieCode
@kodieCode 3 ай бұрын
Thanks for giving me that feedback
@georgekopadze791
@georgekopadze791 Жыл бұрын
Good luck with your channel. Liked your content
@kodieCode
@kodieCode Жыл бұрын
I appreciate it!
@raheelafzal5406
@raheelafzal5406 Жыл бұрын
your content is amazing seriously. i learned so much from this single video of yours,
@kodieCode
@kodieCode Жыл бұрын
Awesome, thank you!
@vaibhavdani4470
@vaibhavdani4470 6 ай бұрын
Gold Gold Goldberg !! Happy to find this channel !!
@kodieCode
@kodieCode 3 ай бұрын
Appreciate the comment.
@tanercoder1915
@tanercoder1915 Жыл бұрын
I enjoyed the video and your accent, as well as learned from you
@kodieCode
@kodieCode Жыл бұрын
Thanks for the feedback!
@retrabaud-it
@retrabaud-it Жыл бұрын
yo bro thank u sooo much, i every day look yt, and try to learn something new, and u speak very easy for me! (sorry for my eng) gl bro at ur way!
@kodieCode
@kodieCode Жыл бұрын
Thanks for the kind comments!
@FreddyF1977
@FreddyF1977 Жыл бұрын
Nice, simple, to the point. Thanks!
@kodieCode
@kodieCode Жыл бұрын
Glad it helped!
@natnaelhailu-com
@natnaelhailu-com Жыл бұрын
Thanks for the helpful tutorial!!!
@kodieCode
@kodieCode Жыл бұрын
Glad it was helpful!
@johnmarynwanze3713
@johnmarynwanze3713 10 ай бұрын
i love it great knowledge been passed here, thanks a lot
@kodieCode
@kodieCode 10 ай бұрын
My pleasure!
@frankie_goestohollywood
@frankie_goestohollywood Жыл бұрын
Excellent content!!!!! Thank you very much 🤓 I would love to see another tutorial with your implementation of local storage.
@kodieCode
@kodieCode Жыл бұрын
Great suggestion!
@wdtrap
@wdtrap 11 ай бұрын
@@kodieCode it looks like maybe you're not making these videos anymore, but consider this comment as another vote for a video on the local storage
@yinkaenochadedokun467
@yinkaenochadedokun467 11 ай бұрын
Great and concise 👍
@kodieCode
@kodieCode 10 ай бұрын
Glad it was helpful!
@justin9494
@justin9494 Жыл бұрын
Thank you! The map part is genius
@kodieCode
@kodieCode Жыл бұрын
Thanks for feedback
@alexandrejunior4775
@alexandrejunior4775 Жыл бұрын
It's amazing! thank you very much!
@kodieCode
@kodieCode 11 ай бұрын
Glad you like it!
@MohammedHusainmobikira
@MohammedHusainmobikira 3 ай бұрын
sir you should create this in full playlist format that we can get more clearity for beginners its bit hard to understand everything, you should also connect it with backend that what routes are set in backend etc.
@MohammedHusainmobikira
@MohammedHusainmobikira 3 ай бұрын
bcz in react js authentication is most confusing part for beginners
@kodieCode
@kodieCode 3 ай бұрын
Noted
@investia_tech
@investia_tech Жыл бұрын
Good work!
@kodieCode
@kodieCode 11 ай бұрын
Thanks!
@isaacjon
@isaacjon Жыл бұрын
Great content. Please release a video about refresh and access tokens
@kodieCode
@kodieCode Жыл бұрын
Thanks for the suggestion. I'll be working on that video soon
@imatrules
@imatrules Жыл бұрын
Hey @@kodieCode any update?
@yourlinuxguy
@yourlinuxguy 9 ай бұрын
Really nice video, Thankyou.
@kodieCode
@kodieCode 9 ай бұрын
Glad you liked it!
@jonasmunkchristensen7384
@jonasmunkchristensen7384 Жыл бұрын
Cool video! Simple and well explained! It would be very helpful to see an implementation with local storage as well as role-based authorization. Regardless, thanks for the awesome content!
@kodieCode
@kodieCode Жыл бұрын
Great suggestion!
@alexmuiruri502
@alexmuiruri502 Жыл бұрын
Hi @kodie, Great content here. However, I'd prefer to show the login page if a user tries to access a private page
@kodieCode
@kodieCode 11 ай бұрын
This is easy enough to do with creating a default route pointing at the login page. That means any route not created based on their status, will show that page instead.
@gustavostarace1252
@gustavostarace1252 Жыл бұрын
Great content, thx!
@kodieCode
@kodieCode Жыл бұрын
Thanks for the feedback
@JasonJamesMoore
@JasonJamesMoore 4 ай бұрын
Is it possible to work things this way using createBrowserRouter. Interested to understand this more, and see if I can use child routes with this kind of setup.
@kodieCode
@kodieCode 3 ай бұрын
It is, yes, React Router has moved on a bit since this tutorial but it's still relevant.
@zstudio6127
@zstudio6127 Жыл бұрын
thanks you for this tut
@kodieCode
@kodieCode Жыл бұрын
Welcome 😊
@Sylar7773
@Sylar7773 Жыл бұрын
Thank You so much!!!
@kodieCode
@kodieCode Жыл бұрын
You're very welcome!
@itsLarryAlright
@itsLarryAlright 9 ай бұрын
Please I need a tutorial on how to use localstorage with this
@kodieCode
@kodieCode 3 ай бұрын
This was with LocalStorage. I'm working on a JWT version
@webhybrid809
@webhybrid809 9 ай бұрын
can you help me to do same thing in next.js, i have to do with user role based , their tho 2 user role , so how to do in next.js with typescript?
@kodieCode
@kodieCode 3 ай бұрын
I don't use next.js as it's best IMO for websites and I'm mainly working on backend and admin panels
@justin9494
@justin9494 Жыл бұрын
How do we add google auth to this?
@kodieCode
@kodieCode Жыл бұрын
I'm planning to do a video on various third party Auth libraries including Google very soon.
@justin9494
@justin9494 Жыл бұрын
@@kodieCode Thanks!
@lokkki9
@lokkki9 9 ай бұрын
@@kodieCode waiting for the video man!!
@balajig3306
@balajig3306 7 ай бұрын
Nice ❤
@kodieCode
@kodieCode 3 ай бұрын
Appreciate it!
@hankpham4431
@hankpham4431 9 ай бұрын
can you make a new video on how not to make user logout whenever the page refresh?
@kodieCode
@kodieCode 3 ай бұрын
It's as simple as looking up the user details from the localStorage on a page reload.
@IXBoyI
@IXBoyI Жыл бұрын
why on refresh it does not hold the private links? It resets and I have to click on "login" again so they pop up
@kodieCode
@kodieCode Жыл бұрын
This is because in that tutorial we are not storing that the user is authenticated in the localStorage or a cookie. This means a refresh of the page restarts the state. I am working on a video to expand on this authentication method and show how to start storing user details including if the user is logged in so that a returning user might be automatically authenticated
@holakonoob
@holakonoob Жыл бұрын
heyy kodie how about make a simple tutorial that is in ts not js and handle auth via jwt cookie not token to be more secure then use R.R.D v6 to protect the routes
@kodieCode
@kodieCode Жыл бұрын
Great suggestion. Thanks for the feedback.
@holakonoob
@holakonoob Жыл бұрын
​@@kodieCode Btw remember my words your channel will grow super fast cause everything is good the audio the video's quality and also the content keep up the good work
@mahletmahi-r5e
@mahletmahi-r5e 10 ай бұрын
yes pls do that user key and session expire thingi we do want it
@kodieCode
@kodieCode 3 ай бұрын
It's possible to add a user lookup to the database on page load but I will add more to this soon
@dchudziak
@dchudziak 4 ай бұрын
Isn't this method easy to bypass? User can easily change ahte isAuthenticated state or isPrivate consts. Is it okay to protect client routes like this and just protect private data on the backend?
@kodieCode
@kodieCode 3 ай бұрын
In theory. the video was meant to help people that were struggling with the exact structure of routes and private content. There are many other things that should be used for security
@VayunEkbote
@VayunEkbote Жыл бұрын
I suggest that you make code along tutorials, with more catchy thumbnails. Your content is great, you will grow fast.
@kodieCode
@kodieCode Жыл бұрын
Thanks for the tip
@alonsoestevam
@alonsoestevam 7 ай бұрын
Why are the extension files `.js` instead of `.jsx`?
@saarza9991
@saarza9991 5 ай бұрын
Doesn't matter it's a framework
@kodieCode
@kodieCode 3 ай бұрын
It won't make an difference.
@ASOCMARCTKD
@ASOCMARCTKD 9 ай бұрын
How can I Implement roles of users?
@kodieCode
@kodieCode 3 ай бұрын
You would just need to add additional layers to the user object and define that in the routes
@PeriklesPeriklesoglu
@PeriklesPeriklesoglu Жыл бұрын
thank you
@kodieCode
@kodieCode Жыл бұрын
Welcome!
@goffardeveloper2056
@goffardeveloper2056 Жыл бұрын
how to add role user sir
@kodieCode
@kodieCode 11 ай бұрын
You would need to add an additional object against the user to define their role and then load the routes depending on what that role is allowed to access.
@ankoh69
@ankoh69 Жыл бұрын
rooutah
@kodieCode
@kodieCode Жыл бұрын
Thanks
@levinmwanganyi3929
@levinmwanganyi3929 3 ай бұрын
Thank you
@kodieCode
@kodieCode 3 ай бұрын
You're welcome
Custom Protected Route Component in React
10:58
Cosden Solutions
Рет қаралды 52 М.
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
React Authentication Crash Course With Firebase And Routing
56:00
Web Dev Simplified
Рет қаралды 661 М.
React Router Tutorial - 15 - Authentication and Protected Routes
19:46
React protected routes in 4 minutes
4:03
Appwrite
Рет қаралды 28 М.
Auth Does NOT Have To Be Hard
17:13
Web Dev Simplified
Рет қаралды 103 М.
Add Auth & Protect Routes in React in 3 Minutes (Kinde)
9:38
Learn React Router v6 In 45 Minutes
46:20
Web Dev Simplified
Рет қаралды 577 М.
The New Way To Create Protected Routes With React Router V6
9:19
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН