diff --git a/ajax.php b/ajax.php index d5e212c2..26a33637 100644 --- a/ajax.php +++ b/ajax.php @@ -9,6 +9,7 @@ include("config.php"); include("functions.php"); include("check_login.php"); +require_once("rfc6238.php"); /* * Fetches SSL certificates from remote hosts & returns the relevant info (issuer, expiry, public key) @@ -304,4 +305,14 @@ if(isset($_GET['scheduled_ticket_get_json_details'])){ echo json_encode($response); +} + +/* + * Dynamic TOTP for client login page + * When provided with a TOTP secret, returns a 6-digit code + */ +if(isset($_GET['get_totp_token'])){ + $otp = TokenAuth6238::getTokenCode($_GET['totp_secret']); + + echo json_encode($otp); } \ No newline at end of file diff --git a/client_asset_copy_modal.php b/client_asset_copy_modal.php index 88a7b474..b22c9269 100644 --- a/client_asset_copy_modal.php +++ b/client_asset_copy_modal.php @@ -43,7 +43,7 @@