<?php
    session_start();
    extract($_POST);
    
    $verifyToken = $_SESSION['rand_token'];
    $dbid = $_SESSION['temp_phpsolid_id'];
    
    if($token == $verifyToken){
        $_SESSION['phpsolid_id'] = $dbid;
        header("Location: ../dashboard/");
    }else{
        echo '<script language="javascript">';
        echo 'alert("Invalid 2FA Token!")';
        echo '</script>';
        //echo '<meta http-equiv="refresh" content="0;url=../2faauth/" />';
    }

?>