User Login
This will check for user login at InfusionSoft and WordPress, both at once.
https://guitarzoom.com/wp-admin/admin-ajax.php
Parameters
Name | Description |
---|---|
action* |
String
_app_user_login
Required
|
log* |
String
email of the user
Required
|
pwd* |
String
password of the user
Required
|
Usage and Samples
$('#loginform').on('submit', function(e){
e.preventDefault()
let str = {
action: '_app_user_login',
log: $(this).find('input[name=log]').val(),
pwd: $(this).find('input[name=pwd]').val(),
};
jQuery.ajax({
type: "POST",
url: 'https://guitarzoom.com/wp-admin/admin-ajax.php',
data: str,
beforeSend: function () {
// maybe a preloader?
},
success: function (data) {
var response = jQuery.parseJSON(data)
if(response.success){
// return login logic, all good
} else {
// return error message
}
},
error: function (jqXHR, textStatus, errorThrown) {
// error handling
}
});
})
Responses
Returns | Value | Description |
---|---|---|
success |
integer
value: 1
|
State of the response |
data |
object
|
Data collection for an user |
data.wp_user_id |
integer
value: 12345
|
WordPress User ID |
data.is_user_id |
integer
value: 56789
|
Infusionsoft User ID |
data.first_name |
string
value: John
|
First name of the user pulled from Infusionsoft |
data.last_name |
string
value: Doe
|
Last name of the user pulled from Infusionsoft |
data.tags |
array
value: 1457,3154
|
User tags pulled from Infusionsoft. |
Returns | Value | Description |
---|---|---|
success |
integer
value: 0
|
State of the response |
message |
string
|
Fail error |