New video implements this same strategy but with a full backend that handles Sign-in, Logout, and registration here: ua-cam.com/video/pGNxoIoLt_Y/v-deo.html
Hey Dennis! First of all, thanks a lot for all the great stuff! Could u do an up-to-date video using React + DRF and how to implement the authentication/register/login with JWT? Maybe a project? Cheers, man!
God bless you @Dennis Ivy I was following your JWT tutorial and got frustrated when you got to the private route part and I spent the entire day on stackoverflow browsing for solutions but found nothing🤣🤣🤣 until I came back to UA-cam and searched for "private route" and this video was one of the first that popped up. Thanks
Thank you so much! Videos with the old outdated router versions are a dime-a-dozen. Couldn't find many other videos that actually explain the new method ^_^
Thank You!! I wasn't upgrading my React version because there was not yet a tutorial about React router v6 😂. Now I can happily work on projects with the new version
Thank you, this was doing my head in. If anyone working on the React Router project sees this, please provide a couple more examples in the docos (could even link to this video if still best practice). There's also scant examples of the redirect _function_ which you can return/throw from loaders, which I suspect replaces or compliments the workflow in this video.
Very good! good teaching, and the fact that I had the github repository helped me a lot, in a few minutes I was able to implement it in my application! Thanks for the content.
thanks for sharing. Just a couple suggestions, you may also want to include dynamic routes(such as id's), and GuestRoutes to redirect the user to home if they are already logged in. But good tutorial with outlet. We used it where I worked at to stack routes and it worked great :)
Thanks man!! Imma subscribe you. I have been trying to fix this issue for last 3 days and I finally did it with your help. Really appreciate it! Keep up the good work and keep on helping programmers out
I was looking for a simple but reliable solution, but this is good to go. Maybe I want to use something like a map function which loops through the object of routes with the responding path names and so on. But need to figure out how, but this solution helps me a lot.
it works fine but we have a problem here after landing login page and we are trying to go back its not happening why beacause in our privateRoute we are NAVIGATING or pushing instead of redirecting or replacing so if user clicks on back button from login its still in login page please provide a solution for this
Great video. Btw if you're having You cannot render a inside another . You should never have more than one in your app. error. Just remove the around the and change it to .... This worked for me.
How would you do this for server sessions where we get session from backend like an API. Won't it render login then go to that home?(assuming auth API call is made inside useEffect)
this works good when the value of the boolean is already there. But what if is set as a result of an asynchronous operation? , like a user being set in an authContext, for example. Wouldn't this cause to be redirected right away, before the value gets updated?
Just make sure, unlike he did in the vid, since it’s just an example, the login var is a state var and that the login page checks for it as well and redirects if true
thank you for the video, i have a question tho, how would you recommend to store the token, to maximize the security in the app ? assuming i already have a backend to handle the token for me
New video implements this same strategy but with a full backend that handles Sign-in, Logout, and registration here: ua-cam.com/video/pGNxoIoLt_Y/v-deo.html
Hey Dennis! First of all, thanks a lot for all the great stuff!
Could u do an up-to-date video using React + DRF and how to implement the authentication/register/login with JWT? Maybe a project?
Cheers, man!
God bless you @Dennis Ivy
I was following your JWT tutorial and got frustrated when you got to the private route part and I spent the entire day on stackoverflow browsing for solutions but found nothing🤣🤣🤣 until I came back to UA-cam and searched for "private route" and this video was one of the first that popped up. Thanks
This is a life saver, I was also following the JWT tutorial and I have been stuck on private routes the whole day until i found this.
Thankyou Dennis. I've been stuck for 3 days implementing protected routes. Watched many videos but it was all complicated. But yours got me through!
Same with me
Implemented this for login using Local Storage and it works like magic.
Thanks so much, You are my React Protected Route Hero.
This is really my favourite feature of the new version . I am using this everytime
Thank you so much! Videos with the old outdated router versions are a dime-a-dozen. Couldn't find many other videos that actually explain the new method ^_^
Thank You!! I wasn't upgrading my React version because there was not yet a tutorial about React router v6 😂.
Now I can happily work on projects with the new version
One of the best videos on Protected Routes in React Ever ! Loved it !
Thank you, this was doing my head in. If anyone working on the React Router project sees this, please provide a couple more examples in the docos (could even link to this video if still best practice). There's also scant examples of the redirect _function_ which you can return/throw from loaders, which I suspect replaces or compliments the workflow in this video.
This video couldn't have come at a better time for me!
You are life saver man. so on to the point and short and simple video. hatsss off to you
You just saved me from hours of banging my head on the desk and questioning the futility of my dreams.
Very good! good teaching, and the fact that I had the github repository helped me a lot, in a few minutes I was able to implement it in my application! Thanks for the content.
Thanks a lot was looking around for a couple of hours on how to do this, solved the problem I had with this video and a bit of tinkering!
This video helped me fix my UX and consequently improve security on my product
Very valuable information explained in a short video, thank you so much Dennis.
Great, video. Direct , incisive and practical.
I was looking for this for so long. Thank you for the video
Thanks for the awesome video, Dennis! It was really a time saver
This is the only yt video in which the Outlet is perfectly explained❤❤
Sir Dennis, all I can say is God richly bless you, sir Thank you
Great video on this topic! Relevant, clear and helpful.
Thanks a lot!
Thank you for taking up this we want more videos like this really good bro
thanks for sharing. Just a couple suggestions, you may also want to include dynamic routes(such as id's), and GuestRoutes to redirect the user to home if they are already logged in. But good tutorial with outlet. We used it where I worked at to stack routes and it worked great :)
This video helped me a lot as I was building a MERN Stack application
Finally a video make sense!
Thanks man, its help me so much to continue lerning about this.
i dont why this channel is so underated omgggg!!! this guy is awesome
☺️
Thanks man!! Imma subscribe you. I have been trying to fix this issue for last 3 days and I finally did it with your help. Really appreciate it! Keep up the good work and keep on helping programmers out
Thank you for this short and focused video.
Thanks a lot man you made my day, i got stuck with this issue for a whole day and this video just fixed it, Thanks a lot mate :)
So much time saved with this video ! Per-fect !
Quick video, Self-Explanatory, Made me hit the Subscribe button 😁😁
Loving React content from you sire 👑
Straightforward, thanks for the video 👌
Bro you rock! Thank you so much for avoiding me some headaches :)
Life saver, It worked without a blink thank you so much
So good for me. Thank you man! You are really hero :)
Love you man ,
Osm explanation with your documentation
Really looking for a video like this , thanks a lot
I was looking for a simple but reliable solution, but this is good to go. Maybe I want to use something like a map function which loops through the object of routes with the responding path names and so on. But need to figure out how, but this solution helps me a lot.
Woow this is good i was actually rendering every component based on user authentication which is pretty inconvenient way
Most underrated channel😢😢😢
Thanks this was a really clean video!
Very straightforward, thank you!!!
Thanks for quick help
thanks a lot dennis..... I was very confused until watch this video
This is a lifesaver, I can't wrap my head around the new version, too many changes. I'll just stick to this for now
Thank you! Great explanation. Was helpful in my React app!
Thank you, it is exactly what I was looking for
Thanks much!! Just what I was looking for
Thank you so much - you saved mine lots of time ✅
after making auth.token : true , if you change the routes manually to "/login" it is directing to login page , but it shouldn't be
Really thank you for this information, really simple and useful explanataion!!!
Thank you so much for explaining this, I was finally able to make it work!
Thanks Dennis that was really helpful.
Amazing video invaluable and straightforward ❤
it works fine but we have a problem here after landing login page and we are trying to go back its not happening why beacause in our privateRoute we are NAVIGATING or pushing instead of redirecting or replacing so if user clicks on back button from login its still in login page please provide a solution for this
hey dennis you just saved my big project , Kudos : )
Perfect! Thanks a lot for the explanation!
exactly what I need ed mahn. Thanks a lot😀
Great video.
Btw if you're having You cannot render a inside another . You should never have more than one in your app. error. Just remove the around the and change it to .... This worked for me.
Perfect, this is amazing.
man, you saved me. THANK YOU!
Great video Dennis. Thank you
Thank you SOOOOOOOOOO Much! This was a life saver! Wish I could give you a hundred more likes.
Great Explanation!
Thanks friend! Helped a lot !! :D
It worked. Lol, Beth Hart is a blues artist. 🤩
Thank you so much. without any doubt i fully understand it and it did really work.
Wow, awesome explaination
thank you! now i know how to create a private route.
awesome video, thanks for sharing!
Very, very, nice video. Thank you.
Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you
Thanks, this video helped me a lot!
You change lives dude
You are the Boss. Thanks a lot! 😘😘👍👍
Thank you, great work!
You saved my life!! Thanks a lot!!!
Awesome! quick and clear! :-)
thanks glad someone has a answer
Very cool man, interesting, used this logic in a app of mine
very helpful video. thanks so much.
really good and informative video
thank you very much!! this was very useful, you explanation was very great and understandable!!, comparin with others videos, so thanks again
You saved my life. Thanks
How would you do this for server sessions where we get session from backend like an API. Won't it render login then go to that home?(assuming auth API call is made inside useEffect)
Thanks a lot. U save my day!
Thank you so much! Will you please make a video about website architecture/MVC?
This is fantastic thank you
This helped me out a lot!!
Thank you Dennis
this works good when the value of the boolean is already there. But what if is set as a result of an asynchronous operation? , like a user being set in an authContext, for example. Wouldn't this cause to be redirected right away, before the value gets updated?
Just make sure, unlike he did in the vid, since it’s just an example, the login var is a state var and that the login page checks for it as well and redirects if true
Wow great explanation tquu😊
Thanks for sharing!
Thank you soo much
thank you for the video,
i have a question tho,
how would you recommend to store the token, to maximize the security in the app ?
assuming i already have a backend to handle the token for me
Thanks, it's very helpful
great one keep it up!
Thanks for informative video I'm understood everything is about auth thanks