-
Notifications
You must be signed in to change notification settings - Fork 808
Update two-factor-authentication.md #7476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updated members two factor example code for Umbraco v16
Thanks for the PR, @AaronSadlerUK 🙌 We will review it asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AaronSadlerUK Thanks again for updating the code snippet. However, I had to make a few small adjustments to get the code working, which I have added as suggestions. Without these changes, the proposed snippet was throwing compilation errors.
Could you take a look and let me know if anything doesn’t make sense?
{% code title="ExampleMemberPage.cshtml" lineNumbers="true" %} | ||
|
||
```csharp | ||
@using Umbraco.Cms.Core.Services; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@using Umbraco.Cms.Core.Services; | |
@using Umbraco.Cms.Core.Models; |
{ | ||
var setupData = await twoFactorLoginService.GetSetupInfoAsync(profileModel.Key, providerName); | ||
foreach (var provider in providerNameList) | ||
{0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{0 | |
{ |
<button type="submit">Disable @providerName</button> | ||
@using (Html.BeginUmbracoForm<UmbTwoFactorLoginController>(nameof(UmbTwoFactorLoginController.ValidateAndSaveSetup))) | ||
{ | ||
<h3>Setup @providerName</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<h3>Setup @providerName</h3> | |
<h3>Setup @provider.ProviderName</h3> |
<h3>Setup @providerName</h3> | ||
<img src="@qrCodeSetupData.SetupCode.QrCodeSetupImageUrl"/> | ||
<p>Scan the code above with your authenticator app <br /> and enter the resulting code here to validate:</p> | ||
<input type="hidden" name="providerName" value="@providerName" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<input type="hidden" name="providerName" value="@providerName" /> | |
<input type="hidden" name="providerName" value="@provider.ProviderName" /> |
<input type="hidden" name="providerName" value="@providerName"/> | ||
<button type="submit">Disable @providerName</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<input type="hidden" name="providerName" value="@providerName"/> | |
<button type="submit">Disable @providerName</button> | |
<input type="hidden" name="providerName" value="@provider.ProviderName" /> | |
<button type="submit">Disable @provider.ProviderName</button> |
Updated members two factor example code for Umbraco v16
📋 Description
Updated the example code in the documentation to work with Umbraco v16
📎 Related Issues (if applicable)
Solves:
umbraco/Umbraco-CMS#18880