I want to make users return back to previous URL after login like if you search any hotels on oyorooms.com or fabhotels.com and then suddenly you login there.
After login you are able to see the previous page or say the previous activity like what you are searching at the site. So, I want to do that in my Angular application.
How to do that?
One thing you can do in this condition, save your previous url in service or localStorage and redirect after login page to the saved previous url.
In my case, I have handled like this:
and In guard :