<?php
// Auto Load Classes
require_once("../../autoloader.php");

// Allowed API Headers
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
header("Access-Control-Allow-Methods: POST");
header("Allow: POST, OPTIONS, PUT, DELETE");
header("Access-Control-Allow-Headers: X-API-KEY, Origin, X-Requested-With, Content-Type, Accept, Access-Control-Request-Method, Access-Control-Allow-Origin");

$headers = apache_request_headers();
$response = array();
$controller = new AccountAccess;

date_default_timezone_set('Africa/Lagos');

// -------------------------------------------------------------------
//  Check Request Method
// -------------------------------------------------------------------

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  // Read and decode JSON input as an object
    $input = file_get_contents('php://input');
    $data = json_decode($input); // Decode as an object

    $email = $data->email;
 
    $result = $controller->recoverUserLogins($email);
   
        echo $result;
        exit();
    
}
?>
