I've written a plugin which intercepts the user.onSaveUser
event.
However if the save fails the user is still redirected to the page specified in the 'redirect' parameter/field of the form. How do I redirect them back to the form with errors and then access those errors?
I've tried craft()->urlManager->setRouteVariables()
but still being returned to the page/URL specified in the original form. If I remove the redirect field from the front-end form I am redirected to the form on error but cannot access the errors sent in craft()->urlManager->setRouteVariables()
.
Any thoughts on how to specify the redirect destination depending on success/fail and also how to send/access the offending error messages in my original template?