I have a router like below:
You could use the 'isActive' prop like so:
const { router } = this.context; if (router.isActive('/login')) { router.push('/'); }
isActive will return a true or false.
Tested with react-router 2.7