mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
FS-7312 #resolve #comment added feature NEEDS_DOC
This commit is contained in:
@@ -885,6 +885,7 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
|
||||
switch_bool_t r = SWITCH_FALSE;
|
||||
const char *passwd = NULL;
|
||||
const char *login = NULL;
|
||||
cJSON *login_params = NULL;
|
||||
|
||||
if (!params) {
|
||||
*code = CODE_AUTH_FAILED;
|
||||
@@ -940,6 +941,23 @@ static switch_bool_t check_auth(jsock_t *jsock, cJSON *params, int *code, char *
|
||||
switch_event_create(&req_params, SWITCH_EVENT_REQUEST_PARAMS);
|
||||
switch_assert(req_params);
|
||||
|
||||
if ((login_params = cJSON_GetObjectItem(params, "loginParams"))) {
|
||||
cJSON * i;
|
||||
|
||||
for(i = login_params->child; i; i = i->next) {
|
||||
if (i->type == cJSON_True) {
|
||||
switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, i->string, "true");
|
||||
} else if (i->type == cJSON_False) {
|
||||
switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, i->string, "false");
|
||||
} else if (!zstr(i->string) && !zstr(i->valuestring)) {
|
||||
switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, i->string, i->valuestring);
|
||||
}
|
||||
}
|
||||
|
||||
DUMP_EVENT(req_params);
|
||||
|
||||
}
|
||||
|
||||
switch_event_add_header_string(req_params, SWITCH_STACK_BOTTOM, "action", "jsonrpc-authenticate");
|
||||
|
||||
if (switch_xml_locate_user_merged("id", id, domain, NULL, &x_user, req_params) != SWITCH_STATUS_SUCCESS && !jsock->profile->blind_reg) {
|
||||
|
||||
Reference in New Issue
Block a user