The _createSocialUser method in our CakePHP project uses a named parameter "options" when calling the find method, which causes issues with parameter parsing. Specifically, the findExistingForSocialLogin custom finder does not correctly retrieve the 'email' parameter, resulting in incorrect query construction.
Proposed Solution:
Modify the _createSocialUser method to pass parameters directly to the find method without using a named parameter
from:
$existingUser = $this->_table->find('existingForSocialLogin', options: ['email' => $email])->first();
to:
$existingUser = $this->_table->find('existingForSocialLogin', ['email' => $email])->first();
public function findExistingForSocialLogin(\Cake\ORM\Query\SelectQuery $query, array $options)
{
return $query->where([
$this->_table->aliasField('email') => $options['email'],
]);
}
The _createSocialUser method in our CakePHP project uses a named parameter "options" when calling the find method, which causes issues with parameter parsing. Specifically, the findExistingForSocialLogin custom finder does not correctly retrieve the 'email' parameter, resulting in incorrect query construction.
Proposed Solution: Modify the _createSocialUser method to pass parameters directly to the find method without using a named parameter