How to get user's information when registering or logging in via ajax form I did search for this but was unable to find the documentation for getting user's data on a return when logging them in from a front-end facing login form (I need to do the same for a registration as well).

I need to get a return of the user's Id and their email.

This is my code for the form. It works fine,  I just cannot seem to find the user's info in the data return so if anyone has an example or suggestion it would be greatly appreciated.

$('#workshop-registration-user-login-form').submit(function (e) {
  e.preventDefault();
  var data = $('#workshop-registration-user-login-form').serialize();

  $.ajax({
    type: 'POST',
    url: '/users/login',
    data: data,
    headers: {'Content-Type': 'application/x-www-form-urlencoded'}
  })
  .success(function(data) {
    console.log(data.currentUserId);

    ...

    // get data populate the fields
  })
  .error(function(data) {
    console.log('error');
  });
Not sure what other user info you're looking for, but Craft's UsersController will only return two things in the JSON response of a successful login for an AJAX request.

A success key set to true and a returnUrl key set to where the login redirect should go to.