Redirect back to previous url when logging in and out

Fixes #154