change the login check from path to route name