Redirecting login/homepage logic