Correcting misbehaviour

master
Brady McDonough 2 years ago
parent 1fe0747eb9
commit 238e6e9757

@ -14,7 +14,9 @@ class Otpauth
public readonly int $digits,
public readonly int $period,
)
{}
{
$this->secret = \rtrim($secret, "=");
}
public static function fromString(string $uri): self
{

@ -38,17 +38,17 @@ class UserManagement implements WorkflowInterface
$html = "<div id=\"enroll\"><form %frm>";
$html .= $this->csrf->emitStr();
$html .= "<p>To add an authenticator to your account, scan the QR code</p>";
$html .= "<img src=%qr alt=\"qr-code\" />";
$html .= "<img src=%qr alt=\"qr-code\" height=256px width=256px/>";
$html .= "<label for=\"totp_challenge\">Enter the authentication code:</label>";
$html .= "<input name=\"totp_challenge\" id=\"totp_challenge\" type=\"text\" >";
$html .= "<input type=\"submit\" value=\"Submit\" />";
$html .= "</form></div>";
$provisioningUri = (new Otpauth(
"taatp",
$this->db->userString($this->userIndex),
"taatp",
$this->hash->keygen(),
"SHA1",
$this->hash->hashType(),
30,
6
))->emitStr();

Loading…
Cancel
Save