Login - Step 2
$form->form_tag(ADMIN_ROOT_URL . "auth2", array(), function($f)
use ($html, $auth_user) { ?>
= $html->flash_errors(); ?>
= $html->flash_notices(); ?>
= $f->label_tag("username", "Username:",
array("class" => "required")); ?>
= h($auth_user->username) ?>
if ($auth_user->totp_secret) { ?>
= $f->label_tag("totp_code", "TOTP Code:",
array("class" => "required")); ?>
= $f->text_field_tag("totp_code", "",
array("autofocus" => "autofocus")) ?>
= $f->submit_tag("Login"); ?>
} else { ?>
$totp = $auth_user->new_totp; ?>
Scan the following QR code in a TOTP-compatible application such as
Google Authenticator:
= $f->hidden_field_tag("totp_secret", $auth_user->totp_secret); ?>
= $f->submit_tag("Proceed"); ?>
} ?>
}); ?>