Good afternoon person, I'm breaking my head here and could not find a solution. What I need is this.
If a user accesses a url by ex: www.site.com.br/produto
it should be redirected to another page with a login type ex: www.site.com/login
.
If he is logged in he wanted the user to be redirected to the previous page, however adding the following parameter at the end of the URL: ?id=CS
In the example I would then give: www.site.com.br/produto?id=CS
window.location.href = '/?id=CS';
The above code redirects only to the home page, but wanted it to go back to the previous page it tried to access.