Data is not being passed from ajax to controller (using POST)

Hello! I`m trying to make google authentication. In add.php(templates file) I wrote this javascript code .

function singIn() {//<------this is called when button is pressed

var userInfo = JSON.stringify(user);
$.ajax({
method: “POST”,
url: “<?= Router::url(array('controller' => 'Users', 'action' => 'googlesignin')); ?>”,
data: {
userInfo
},
success: function(data) {
console.log(“Signed in google!”);
},

                error: function(param) {
                    console.log("Something went wrong" + param.responseText.message);
                    console.log("-----------------------");
                    console.log(param);
                }
            });

I am getting google pop and everything is working with out any errors but data is not getting passed to controller. My controller

public function googlesignin(){

    $user = $this->Users->newEntity();

    $user->email = $_POST['data']['email'];
    $user->name = $_POST['data']['displayName'];        
    $this->Users->save($user);
}

I also added this
$builder->connect(’/’, array(‘controller’ => ‘Users’, ‘action’ => ‘googlesignin’));
in routes.php.

Can anyone please help me?

What do your input fields look like? And why are you using $_POST instead of accessing this data through the request function provided for that purpose?

Could you give me example for request function?

https://book.cakephp.org/3/en/controllers/request-response.html#request-body-data