In this video I show you how to redirect users to the page they were trying to go to before they logged in. This is an easy way to enhance the user experience. Code 👨💻 github.com/les...
very good, short, precise and to the point, I would recommend defining the OnClick functions in separate handles so as not to mix HTML with javascript logic.
thank you so much ....... i already search in google more than 30 minutes but don't fix my problem but after watching your video i fixed this problem ........... thank you.....
Hi. I love your contents. But I believe when you're on a series, you should always link back to the previous tutorial concerning that same series you're on. For instance, you spoke about the fact that on the previous lesson, the account page was protected and redirects users back to the login page. I believe there should be a link in the description pointing to the previous lesson/video just incase anyone would be interested like myself. Instead of going to your channel and searching for 8 months old video, one can just see the link from here. It's much better don't you think? You can also put it in the card above aswell. Overall, awesome content
Ughhh, for some reason, my login page goes away after entering credentials and sends me to the home page; but if I click a link, it boots me back to the login page. The context isn’t persisting, I’m assuming it’s because of re-renders
Thanks for this amzaing Video... pls how do I handle the display of a page only for first time users. eg an agreement page, once accepted, the user never gets to see the page again
There have been a lot of people that redirect bad programming into your system. So I prefer not to allow any access to systems. I have read plenty of bug reports. I don't like it 😜
Thanks for explain this point, but i have an issue in another part, i want to not allow the user to go to the login page or sign up page after login, how can i achieve that ?
How would one use this if I’ve setup routes ? For example, I’m updating an old project to Es6, the routes were setup in es5 version, so I had to change them to: But, I can’t figure out how to convert the old es5 on the login from what normally looks like this : {user ? : } To a newer way of redirecting, I also understand I have to use Navigate instead of Redirect.. could you give some insight on this?
I'm actually editing a video right now where I touch on that topic more in depth. Essentially just replace Redirect with Navigate and you should be good to go brother.
This is still not covering some other situations, like failed log in, incorrect credentials etc... and if you are using Redux, you cannot return the state to onClick handler, it will come back as mapStateToProps
In the case of incorrect credentials or failed log in you can simply not navigate/redirect the user unless the credentials are verified on the back end. I don't use Redux but if you want to see a more in depth example with the React Context API you could check out my authentication video for the full stack chat app series. I will also be posting more authentication videos soon.