I am creating custom module which redirect to login if third party module route id find.(frontend)
but i have issue how to identify the current route is default or third party route ?
how to check current route is default or third party ?
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
I can give you some hint for this problem.
You can try by looking into class \Magento\Framework\App\Route\Config at file
the function _getRoutes of Magento2 will return list of route's info as below.
(You may have to extend a new class from this because the scope of function is protected )
Based on current route as a frontName, you can extract the module info of this route as modules. From that you can know whether this module belong to Magento 2 default route or not.
I hope this will work for you.