fixed post-login/logout redirection to work for custom routes