Open MadCat34 opened 5 years ago
If I'm not mistaken you should be able to overwrite the path of those routes in configuration without changing the name of the routes. For example:
return [
'router' => [
'zfcuser' => [
'path' => 'dashboard/user',
],
],
];
I'm not at my computer right now to test it, but I think that should work.
This is what I have done. But going to dashboard/user with unregistered user redirect to user/login.
The problem is the use of constants (see UserController::indexAction)
public function indexAction()
{
if (!$this->zfcUserAuthentication()->hasIdentity()) {
return $this->redirect()->toRoute(static::ROUTE_LOGIN);
}
return new ViewModel();
}
If you want to redirect to a custom route, actually you have to extends UserController...
Some routes are defined as constants in UserController
In order to change these routes, we should extend UserController.
It should be configurable with the moduleOptions.
I have overwrited routes to use dashboard/user dashboard/user/login [...] using UserController and action from ZfcUser.
If I go to /dashboard/user, and if I'm not logged, UserController redirect me to ROUTE_LOGIN (/user/login) instead of /dashboard/user/login
IMO, Configurable options is easier than extend UserController
What is your opinion about this ?