This commit is contained in:
@@ -49,9 +49,10 @@ else if ($_SESSION["needs_auth"]===false && $_SESSION["mfa_authenticated"]==1 &&
|
||||
$user_id=$_SESSION["id"];
|
||||
$valid_until=time()+(15*60);
|
||||
$auth_token=bin2hex(random_bytes(128));
|
||||
$auth_token_hash=auth_token_hash($auth_token);
|
||||
$sql="INSERT INTO auth_tokens (auth_token,user_id, valid_until) VALUES(?,?,?);";
|
||||
$stmt = mysqli_prepare($conn, $sql);
|
||||
mysqli_stmt_bind_param($stmt, 'sii', $auth_token,$user_id,$valid_until);
|
||||
mysqli_stmt_bind_param($stmt, 'sii', $auth_token_hash,$user_id,$valid_until);
|
||||
mysqli_stmt_execute($stmt);
|
||||
mysqli_stmt_close($stmt);
|
||||
if(!empty($send_to)){
|
||||
|
||||
Reference in New Issue
Block a user