Zend Framework 2 - ZFCUser action whitelisting doe

2019-07-29 10:26发布

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条回答
劫难
2楼-- · 2019-07-29 11:01

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...

查看更多
登录 后发表回答