CakeDC / users

Users Plugin for CakePHP
https://www.cakedc.com
Other
521 stars 296 forks source link

Allow logic in RegisterTrait to customize Flash messages #938

Open Modicrumb opened 3 years ago

Modicrumb commented 3 years ago

In register trait the following code exists:

        if ($userSaved) {
            return $this->_afterRegister($userSaved);
        } else {
            $this->set(compact('user'));
            $this->Flash->error(__d('cake_d_c/users', 'The user could not be saved'));

            return;
        }

I kind of want to be able to customize the Flash error message not with translations but with an if block, I might want to change the flash based on certain errors given back from the entity. Would this be worth it to do via an event or something of that nature?

ajibarra commented 2 months ago

@steinkel @rochamarcelo we could configure flash messages in users config. However do we want that specific customization? If so we can implement it in latest version, otherwise we can close the issue