We are using v7 of the Okta Login Widget. The following code makes the ajax call to our Login controller when the user account doesn’t have MFA enabled. However, when MFA is enabled the code doesn’t return to where we do the ajax call. How do I either get the code to return so that the ajax call is made, or is there another option?
function (error) {
oktaSignIn.showSignInToGetTokens({
el: '#okta-login-container'
}).then(function (tokens) {
oktaSignIn.authClient.tokenManager.setTokens(tokens);
oktaSignIn.remove();
var data = {
accessToken: tokens.accessToken.accessToken,
idToken: tokens.idToken.idToken
};
$.ajax({
type: "POST",
url: "/Login/SubmitLogin",
data: addAntiForgeryToken(data)
})
.done(function (response) {
window.location = response.RedirectUrl;
})
.fail(function (response) {
global.AjaxFailedRedirect(response);
});
}).catch(function (err) {
console.error(err);
});
});type or paste code here