The Login extra uses the MODX processor security/login to log in a user.
I guess if you have the [[!Login]] snippet on a page, you could make an AJAX request to this page (with the parameters for “user” and “password”) and the user should get logged in.
A cleaner solution is probably to create a REST endpoint for the login and call the security/login processor yourself:
But it doesn’t seem that you created a rest API on your site.
How do you handle AJAX requests to your site? With normal MODX resources that return JSON?