blob: 9a98fd04a9cf1f59424204df2460aa1ddd187f4e [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001<?php
2require_once(__DIR__."/../core.php");
3security::checkType(security::WORKER, security::METHOD_NOTFOUND);
4secondFactor::checkAvailability();
5
6if ($_SERVER['REQUEST_METHOD'] !== "POST") {
7 api::error('This method should be called with POST.');
8}
9
10try {
11 $result = secondFactor::createRegistrationChallenge();
12} catch (Throwable $e) {
13 api::error('An unexpected error occurred: ' . $e->getMessage());
14}
15
16api::write($result);