S
S
Salamander5552020-05-14 02:15:54
JavaScript
Salamander555, 2020-05-14 02:15:54

The search script only works on a non-authorized page, how is it possible to make the search authorized?

the script itself:

function loadData(container, progress, pageCode, codes){
  $.ajax({
    url: '/abwpload?pagecode=' + pageCode + '&codes=' + codes,
    type: 'GET',

    contentType: 'application/json; charset=utf-8',
    success: function (completeData) {
      container.hide();

      $('<link>')
        .appendTo('head')
        .attr({
          id: 'search_link',
          type: 'text/css',
          rel: 'stylesheet',
          href: completeData.cssLink
        }).load(function () {
          container.html(completeData.html);
          //initFilters(container);
          initUniLine(container);
          progress.hide();
          container.fadeIn(1500);

          checkFooter();
        });
    }
  });
}


The script contains url: /abwpload?pagecode=' + pageCode + '&codes=' + codes,
for an unauthorized user, the link matches the elements in the script: for example, /abwpload?pagecode=list-920955&codes=en-mkt-3

for an authorized user url is already changing: /Account/RegisterInternal?type=SignIn&id=342173

How can I write in the script that it reacts to the authorized one?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arseny, 2020-05-14
Matytsyn @ArsenyMatytsyn

The problem is not in this code. The request obviously goes to the root (begins with a slash) and cannot be changed without external help.
Therefore, I recommend looking for the source of the conflict elsewhere. For example:
1. You may have an explicit redirect somewhere.
2. The registered user gets to another domain \ directory, which is root and because of this the request is distorted (fantastic, but why not).
3. You're just looking in the wrong place trying to find the problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question