9
In my User Authentication I need to set a Condition (verified = 1) for the Login to happen. I know that I should be able to do it like this:
$this->Auth->userScope = array('User.verified' => '1');
I tried this in AppController and my UsersController beforeFilter function, but it doesn't do anything. Is there anything else I need to configure for this?
I ended up doing (AppController):
public function isAuthorized($user) {
if ($user['verified'] == '0') {
$this->Session->setFlash('You need to verify your Account first.');
return false;
}
return false;
}
This seems to be inelegant, since there should be the proper (userScope) way to do it, plus I now get two Flashes when verified = 0: The first one is the setFlash from above, and the second one is the regular authError.
I checked both, the Docs and stackoverflow, but I found very little information on this topic.