ARTICLE AD BOX
I haven't used this application/website in a couple of months. I tired using it today and it's failing. The login page gets a token and passes it to the main processing .html that calls common.js. When checking the dev tools, the function POSTs, the Authorization: in Networks/Headers looks correct, but the response is "success":false,"token":null}".
I'm about to tear my hair out, as it must be something simple.
It's hosted by GoDaddy and we had to upgrade from PHP7.4 to 8.4. Could that cause the issue?
If I use an invalid user name or password, everything works as expected. If I enter a valid name and password, I get this failure.
Any thoughts?
Here's code, where I've removed all the processing and am only displaying messages on the console:
function getDate() { var token = sessionStorage.getItem('token'); console.log("common.js: getDate called, token =", token); if (!token) { console.warn("common.js: No token found!"); return; } var settings = { type: 'POST', url: app_url + '/v1/date-list', beforeSend: function(xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + token); xhr.setRequestHeader('Content-Type', 'application/json'); console.log("common.js: Authorization and Content-Type headers set"); }, data: JSON.stringify({}), // send empty JSON payload dataType: 'json', success: function(data) { console.log("common.js: Date-list response:", data); }, error: function(jqXHR, textStatus, errorThrown) { console.error("common.js: AJAX error", textStatus, errorThrown); console.log("common.js: Full jqXHR object:", jqXHR); }, complete: function(jqXHR, textStatus) { console.log("common.js: AJAX request complete, status:", textStatus); } }; console.log("common.js: var settings, token =", token); console.log("common.js: var settings, headers =", Headers); console.log("common.js: AJAX settings prepared:", settings); $.ajax(settings); }Here's the console messages:
common.js: document ready common.js:91 common.js: getDate called, token = be3ab17447c7a43493d1bcb123cb3a03 common.js:121 common.js: var settings, token = be3ab17447c7a43493d1bcb123cb3a03 common.js:122 common.js: var settings, headers = ƒ Headers() { \[native code\] } common.js:123 common.js: AJAX settings prepared: {type: 'POST', url: 'https://api.visioncrux.com/v1/date-list', data: '{}', dataType: 'json', beforeSend: ƒ, …} common.js:104 common.js: Authorization and Content-Type headers set common.js:40 common.js: Token exists, loading ticker data if applicable common.js:55 common.js: getTickerListData called with: {Asofdate: '', asset: '', category: '', tickerValue: '', fundValue: ''} common.js:154 common.js: DataTable plugin not loaded! common.js:110 common.js: Date-list response: {success: false, token: null} common.js:117 common.js: AJAX request complete, status: success