J
J
JayDeeZz2018-09-19 17:28:05
Google
JayDeeZz, 2018-09-19 17:28:05

Google authorization. How to pass parameters via ajax?

I need to send parameters after authorization: first name, last name, ajax request and then refresh the page. I do authorization and that everything comes to crm. I am using the POSTMAN program to create requests. After authorization, I get all the information by this function.

<script>
function onSignIn(googleUser) {
  var profile = googleUser.getBasicProfile();
  console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
  console.log('Name: ' + profile.getName());
  console.log('Image URL: ' + profile.getImageUrl());
  console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
  
}

</script>

Everything is displayed in the console, but it is necessary that after authorization everything sends ajax
POSTMAN says that
var settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://www.localhost.com/property-organizer-login/?firstName=1&lastName=2&[email protected]",
  "method": "POST",
  "headers": {
    "Cache-Control": "no-cache",
    "Postman-Token": "29cc33c6-112b-457f-91fd-75ed43e6b669"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

this should work, but I don’t understand how to use everything correctly)
It turns out that it should be on the output
1) log
in 2) send everything to crm
3) and refresh this page

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question