Hey all I am new to Oracle JET and I have a problem
we try to upgrade our app to version 12 and some of the code that works now does not function well
I try to do login into the app with ajax like before the upgrade and for some reason, I can't understand it not working and I don't get an output\error code that I can try to understand the problem.
this is the code the problem happen :
await $.ajax({
url: self.rootModel.usersLoginRestURL(),
data: {
username: self.username(),
password: self.password()
},
type: 'POST',
xhrFields: {
withCredentials: true
},
error: function (request, status, error) {
console.log(`Login Failed.`)
},
statusCode: {
403: function(response) {
console.log(`Access Error: (Forbidden) Attempted access to forbidden resource.`);
alert(`Incorrect username or password when attempting login.`)
},
401: function(response) {
console.log(`Access Error: (Unauthorized) Incorrect username or password when attempting login.`)
alert(`Incorrect username or password when attempting login.`)
},
},
success: (function (results){
const delay = Math.max(100, parseInt(results.accessTokenExpiryMillis) - 5000);
setTimeout(self.rootModel.refreshTokens, delay);
self.rootModel.accessToken(results.accessToken);
self.loginResponse(results)
console.log(results);
}),
});
hope you can help.