Reputation: 21
I am using ZfcUser
via HybridAuth
for enabling Facebook Authentication in Zend
Framework 2
. I downloaded the scn-social-auth
module and added into my project. Now, the Controller user
under ZfcUser
module is protected. That is, if I am not logged in, it will redirect me to the login page.
User not logged in: visit "http://localhost/user" => will redirect to: "http://localhost/user/login"
Now, I want to protect all my Controller Actions with ZfcUser
. That is, any module I create, if I the user is not logged in, it should redirect me to "http://localhost/user/login". What is the best of doing this? I can check whether the user is logged in each of the action in each module. But, it doesn't look like a good option. Any suggestion?
Regards,
Shiva
Upvotes: 2
Views: 2078
Reputation: 392
Some code that may be useful is included in an issue for ZfcUser: https://github.com/ZF-Commons/ZfcUser/issues/187, which provides a clean and neat solution for this trouble.
Hope this helps :-)
Upvotes: 3