<commit_before>﻿@model TwoFactorAuthenticationViewModel
@{
    ViewData["Title"] = "Two-factor authentication";
    ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication);
}

<h4>@ViewData["Title"]</h4>
@if (Model.HasAny2faProviders)
{
    if (Model.Is2faEnabled)
    {
        if (Model.RecoveryCodesLeft == 0)
        {
            <div class="alert alert-danger">
                <strong>You have no recovery codes left.</strong>
                <p>You must <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a> before you can log in with a recovery code.</p>
            </div>
        }
        else if (Model.RecoveryCodesLeft == 1)
        {
            <div class="alert alert-danger">
                <strong>You have 1 recovery code left.</strong>
                <p>You can <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
            </div>
        }
        else if (Model.RecoveryCodesLeft <= 3)
        {
            <div class="alert alert-warning">
                <strong>You have @Model.RecoveryCodesLeft recovery codes left.</strong>
                <p>You should <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
            </div>
        }
    }

    @if (Model.Is2faEnabled)
    {
        <a asp-action="Disable2faWarning" class="btn btn-default">Disable two-factor authentication</a>
    }
    else
    {
        <form asp-action="Enable2fa" method="post">
            <button type="submit" class="btn btn-default">Enable two-factor authentication</button>
        </form>
    }

    if (Model.Is2faEnabled)
    {
        <a asp-action="GenerateRecoveryCodes" class="btn btn-default">Reset recovery codes</a>
    }
}

<h5>Authenticator app</h5>
@if (!Model.HasAuthenticator)
{
    <a asp-action="EnableAuthenticator" class="btn btn-default">Add authentiator app</a>
}
else
{
    <a asp-action="EnableAuthenticator" class="btn btn-default">Configure authenticator app</a>
    <a asp-action="ResetAuthenticatorWarning" class="btn btn-default">Reset authenticator key</a>
}

@section Scripts {
    @await Html.PartialAsync("_ValidationScriptsPartial")
}<commit_msg>Fix typo<commit_after>@model TwoFactorAuthenticationViewModel
@{
    ViewData["Title"] = "Two-factor authentication";
    ViewData.AddActivePage(ManageNavPages.TwoFactorAuthentication);
}

<h4>@ViewData["Title"]</h4>
@if (Model.HasAny2faProviders)
{
    if (Model.Is2faEnabled)
    {
        if (Model.RecoveryCodesLeft == 0)
        {
            <div class="alert alert-danger">
                <strong>You have no recovery codes left.</strong>
                <p>You must <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a> before you can log in with a recovery code.</p>
            </div>
        }
        else if (Model.RecoveryCodesLeft == 1)
        {
            <div class="alert alert-danger">
                <strong>You have 1 recovery code left.</strong>
                <p>You can <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
            </div>
        }
        else if (Model.RecoveryCodesLeft <= 3)
        {
            <div class="alert alert-warning">
                <strong>You have @Model.RecoveryCodesLeft recovery codes left.</strong>
                <p>You should <a asp-action="GenerateRecoveryCodes">generate a new set of recovery codes</a>.</p>
            </div>
        }
    }

    @if (Model.Is2faEnabled)
    {
        <a asp-action="Disable2faWarning" class="btn btn-default">Disable two-factor authentication</a>
    }
    else
    {
        <form asp-action="Enable2fa" method="post">
            <button type="submit" class="btn btn-default">Enable two-factor authentication</button>
        </form>
    }

    if (Model.Is2faEnabled)
    {
        <a asp-action="GenerateRecoveryCodes" class="btn btn-default">Reset recovery codes</a>
    }
}

<h5>Authenticator app</h5>
@if (!Model.HasAuthenticator)
{
    <a asp-action="EnableAuthenticator" class="btn btn-default">Add authenticator app</a>
}
else
{
    <a asp-action="EnableAuthenticator" class="btn btn-default">Configure authenticator app</a>
    <a asp-action="ResetAuthenticatorWarning" class="btn btn-default">Reset authenticator key</a>
}

@section Scripts {
    @await Html.PartialAsync("_ValidationScriptsPartial")
}
{'fraction_non_alphanumeric': 0.12920192087811572, 'fraction_numerical': 0.006402927052366796, 'mean_word_length': 2.6818181818181817, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2685153', 'n_tokens_mistral': 1317, 'n_tokens_neox': 1306, 'n_words': 291}