2021
had 2FA system in 2020 working and now in 2021 having some minor issues with code not firing.
have 2 custom forms otp.php / verify1.php ( generated and sitting in the views folder)
otp is the main file that gets displayed if 2fa is enabled, the user enters the 6 digit code to validate the account with a “validate” button which then fires an ajax script (verify1.php) to check the code entered.
in otp.php, the call code is as follows:
(sURL set to current path… assuming its being executed in the views folder, but not sure)
$(“#verify”).click(function() {
var sURL = ‘Verify1.php’;
$.ajax({
url: sURL,
type: ‘POST’,
data: {
otp: $(“#otp”).val()
},
}).done(function (data) {
if(data == ‘Validated’)
window.location.assign(“Dashboard2.php”);
else
$(“#status”).html(“
}).fail(function (data) {
$(“#status”).html(“
});
});
this was firing in 2020 (the 2fa code was in its own folder), it does get called but does not actually execute the verify1.php script, along with this I’'ve noticed that $(“#status”).html(“
as well, when i view the “data” variable it appears to have code for the page html display. I’ve put break points in the controller/models classes and nothing is being hit.
i’ve also altered the sURL variable and it is behaving differntly depending on what path i put, but still verify1.php doesn’t fire.
the otp.php was generated by phpmaker and contains only my custom code and a few lines that were auto generated
<? php namespace PHPMaker2021\myNamespace; // Page object $Otp = &$Page; ?>< php
CUSTOM 2FA CODE
?>
any help appreciated