Password protect whole staging site. Redirect to original page not working I'm trying to password protect a staging site. So I've put a {% requireLogin %} at the top of my _layout.html inside of a conditional tag. It's working except the redirect after login always goes to the dashboard instead of the original page. What am I doing wrong?

I'm aware of the possibility of using htaccess protection, but I think doing it the "Craft way" is nicer.
{% requireLogin %} is intended for use with your own login form on the frontend rather than the standard /admin one. From the docs for loginPath:


  The URI Craft should use for user login on the front-end.


Which means you create your own frontend login form, and set that as the loginPath. As you don't have that, it's defaulting to the default login instead, which redirects users to the admin dashboard instead of the page they were on.