completing the auth fix
Revert "backporting an auth fix (only extract referer url for login when the user is redirected to login)"

This reverts commit 99d3a4f3a15211e6da8fe5d4952c4a814a6a5d0e.
Merge branch 'master' into fixup