Normalize Flash message usages in LoginTrait
Check other traits too
Why? I don't understand this issue.
Some Flash messages use the "auth" key in LoginTrait, we should use the either default or auth flash messages across the Plugin.
Make it configurable. I can't say if it should have a key or not. I know that I render the default in my layout.ctp in my apps. Having to keep track of flash keys is a pain.
@steinkel AuthComponent already has a configuration option for this.
The AuthComponent has defaults for flash like this.
$defaults = [
'authenticate' => ['Form'],
'flash' => [
'element' => 'default',
'key' => 'auth',
'params' => ['class' => 'error']
],
'loginAction' => [
'controller' => 'Users',
'action' => 'login',
'plugin' => null
],
'logoutRedirect' => $this->_config['loginAction'],
'authError' => __d('cake', 'You are not authorized to access that location.')
];
As long as the AuthComponent is loaded before the plugin. The plugin can just $controller->Auth->config('flash.key'); to get the value.
looks like the core is forcing us to fix this now with the upgrade to 3.4 :+1: