I’m doing a Fetch/POST to a login page of a 3rd party website.
The code is fairly simple.
let form = new FormData();
form.append( ‘username’ , myUsername);
form.append( ‘password’ , myPassword);
var headers = { ‘method’ : ‘post’ ,
‘body’ : form,
‘credentials’ : ‘include’ }
fetch( LoginURL, headers)
.then( loginResponse => { console.log( loginResponse ); })
. catch ( loginError => { console.log( “failed connection” ); })
I can monitor the loginResponse (cookies) to determine if the login was successful or not.
I first tested this code using the Chrome Browser Developer console, testing with both a correct and incorrect password being sent.
Incorrect Password → Returned with ‘Not Logged In’
Correct Password → Returned with ‘Login Success’
Then I did the same thing from the Wix backend developer test (Or testing with live site)
Incorrect Password → Returned with ‘Not Logged In’
Correct Password → WebMethod Request Timed Out
The connection typically takes about 1 second. It is not an actual time out, but rather seems that something is being rejected.
It doesn’t seem like this is the fault of the 3rd party site, since I can test with different origins with success. Only testing from Wix does it fail. Any ideas?