btcpayserver/BTCPayServer/Views/Manage/EnableAuthenticator.cshtml
Wouter Samaey f1a222fbb3
New unit test to scan for external links/forms and if they have rel="noreferrer noopener" (#2668)
* Unit test to check for (possibly) external links

* Add rel="noreferrer noopener" to all external links so unit test passes

* Update BTCPayServer.Tests/UnitTest1.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Update BTCPayServer.Tests/UnitTest1.cs

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>

* Fixed bad merge from master

* PascalCasing

Co-authored-by: Andrew Camilleri <evilkukka@gmail.com>
2021-07-06 10:35:42 +02:00

72 lines
3.1 KiB
Plaintext

@model EnableAuthenticatorViewModel
@{
ViewData.SetActivePageAndTitle(ManageNavPages.TwoFactorAuthentication, "Enable authenticator app");
}
<div>
<p>To use an authenticator app go through the following steps:</p>
<ol class="list">
<li class="mb-5">
<div class="mb-2">Download a two-factor authenticator app like …</div>
<ul>
<li>
Microsoft Authenticator for
<a href="https://go.microsoft.com/fwlink/?Linkid=825072" rel="noreferrer noopener">Android</a> or
<a href="https://go.microsoft.com/fwlink/?Linkid=825073" rel="noreferrer noopener">iOS</a>
</li>
<li>
Google Authenticator for
<a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&amp;hl=en" rel="noreferrer noopener">Android</a> or
<a href="https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8" rel="noreferrer noopener">iOS</a>
</li>
</ul>
</li>
<li class="mb-5">
<p class="mb-2">Scan the QR Code or enter the following key into your two factor authenticator app:</p>
<p class="mb-4">
<code class="me-3">@Model.SharedKey</code>
<span class="text-secondary">(spaces and casing do not matter)</span>
</p>
<div id="qrCode"></div>
<div id="qrCodeData" data-url="@Model.AuthenticatorUri"></div>
</li>
<li>
<p>
Your two factor authenticator app will provide you with a unique code.
<br/>
Enter the code in the confirmation box below.
</p>
<div class="row">
<div class="col-md-6">
<form method="post">
<input asp-for="AuthenticatorUri" type="hidden" />
<input asp-for="SharedKey" type="hidden" />
<div class="form-group">
<label asp-for="Code" class="form-label">Verification Code</label>
<input asp-for="Code" class="form-control" autocomplete="off" />
<span asp-validation-for="Code" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Verify</button>
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
</form>
</div>
</div>
</li>
</ol>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial" />
<script src="~/js/qrcode.js" asp-append-version="true"></script>
<script>
new QRCode(document.getElementById("qrCode"), {
text: @Safe.Json(Model.AuthenticatorUri),
width: 200,
height: 200,
useSVG: true,
correctLevel : QRCode.CorrectLevel.M
});
$("#qrCode > img").css({ "margin": "auto" });
</script>
}