blob: 9a98fd04a9cf1f59424204df2460aa1ddd187f4e [file] [log] [blame]
<?php
require_once(__DIR__."/../core.php");
security::checkType(security::WORKER, security::METHOD_NOTFOUND);
secondFactor::checkAvailability();
if ($_SERVER['REQUEST_METHOD'] !== "POST") {
api::error('This method should be called with POST.');
}
try {
$result = secondFactor::createRegistrationChallenge();
} catch (Throwable $e) {
api::error('An unexpected error occurred: ' . $e->getMessage());
}
api::write($result);