Skip to content

Commit

Permalink
Two Factor Authentication Validation V2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jave Lupango committed Dec 16, 2020
1 parent e947f61 commit 8a286ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion view/auth/2authfactor.front.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@
$val_auth = $c_Select->fn_SingleResponse($conn, "SELECT * FROM 2authfactor WHERE status='active' AND duration > 0 AND userid = ? ORDER BY dt DESC LIMIT 1", "code", $get_data);
if(trim($_POST["twoauthfact"]) === trim($val_auth))
{
$val_username = $c_Select->fn_SingleResponse($conn, "SELECT * FROM 2authfactor WHERE status='active' AND duration > 0 AND userid = ? ORDER BY dt DESC LIMIT 1", "userid", $get_data);
$_SESSION["username"] = $val_username;
echo "success - ". $val_auth;
$c_Del->deleteRecord($conn, "UPDATE 2authfactorlogs SET status='enactive', try= 0 WHERE username='$get_data'");
$c_Del->deleteRecord($conn, "UPDATE 2authfactor SET status='enactive', WHERE userid='$get_data'");
header("Location: ".$url."/home");
}
else
{
echo "Error Code";
echo "<center><b>Error Code Validation</b><center>";
}
//echo $_POST["twoauthfact"];
}
Expand Down

0 comments on commit 8a286ee

Please sign in to comment.