I have authentification system that allow login by email or phone number. How I can write custom scope
, that will set username
field to email
if it contain @
and if not to phone
?
'authenticate' => array(
'FormExtended' => array(
'fields' => array(
'username' => 'email',
'password' => 'password',
),
'scope' => array(
'User.active' => true,
),
)
)
Can this be done with scope condition ?