Zend Framework 2 - ZFCUser action whitelisting does not work for rerouting

夙愿已清 提交于 2019-12-11 13:14:28

问题


I'm using this function for whitelisting a few actions from the ZFCUser login.

Everything works great unless I redirect to one of these whitelisted pages. For example I have the myFormAction which reroutes in case of an invalid form to itself or to a successAction.

The problem is now that after clicking the button in any of these cases I end up seeing the ZFCUser login. When I go to one of these pages via URL or link there the first time, it works.

Here is my code for the two cases in myFormAction:

Failure:

return array('myVar' => $myVar);

Success:

return $this->redirect()->toRoute('myModule', array('action' => 'Success'));

Any ideas what I might be doing wrong? Is maybe the rerouting not passing the onBootstrap function and ZFCUser blocks it somewhere else?

Thanks!


回答1:


Ok, that was a stupid one!

There was an error in my link url which wasn't shown because of the ZFCUser's redirecting!

Logging in showed the real path and revealed the error...



来源:https://stackoverflow.com/questions/16147533/zend-framework-2-zfcuser-action-whitelisting-does-not-work-for-rerouting

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!