Skip to content

Commit e67b8a8

Browse files
committed
Updates
1 parent 19f22b9 commit e67b8a8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

aspnetcore/blazor/security/webassembly/standalone-with-identity/qrcodes-for-authenticator-apps.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Add the following class signatures to the `IAccountManagement` interface. The cl
135135

136136
* Log in with a 2FA TOTP code (`/login` endpoint): `LoginTwoFactorCodeAsync`
137137
* Log in with a 2FA recovery code (`/login` endpoint): `LoginTwoFactorRecoveryCodeAsync`
138-
* Make a 2FA management request (`/manage/2fa` endpoint): `TwoFactorRequest`
138+
* Make a 2FA management request (`/manage/2fa` endpoint): `TwoFactorRequestAsync`
139139

140140
`Identity/IAccountManagement.cs` (paste the following code at the bottom of the interface):
141141

@@ -150,7 +150,7 @@ public Task<FormResult> LoginTwoFactorRecoveryCodeAsync(
150150
string password,
151151
string twoFactorRecoveryCode);
152152

153-
public Task<TwoFactorResult> TwoFactorRequest(
153+
public Task<TwoFactorResult> TwoFactorRequestAsync(
154154
TwoFactorRequest twoFactorRequest);
155155
```
156156

@@ -300,18 +300,18 @@ public async Task<FormResult> LoginTwoFactorRecoveryCodeAsync(string email,
300300
}
301301
```
302302

303-
A `TwoFactorRequest` method is added, which is used to manage 2FA for the user:
303+
A `TwoFactorRequestAsync` method is added, which is used to manage 2FA for the user:
304304

305305
* Reset the shared 2FA key when `TwoFactorRequest.ResetSharedKey` is `true`. Resetting the shared key implicitly disables two-factor authentication. This forces the user to prove that they can provide a valid TOTP code from their authenticator app to enable 2FA after receiving a new shared key.
306306
* Reset the user's recovery codes when `TwoFactorRequest.ResetRecoveryCodes` is `true`.
307307
* Forget the machine when `TwoFactorRequest.ForgetMachine` is `true`, which means that a new 2FA TOTP code is required on the next login attempt.
308308
* Enable 2FA using a 2FA code from a TOTP authenticator app when `TwoFactorRequest.Enable` is `true` and `TwoFactorRequest.TwoFactorCode` has a valid TOTP value.
309309
* Obtain 2FA status with an empty request when all of `TwoFactorRequest`'s properties are `null`.
310310

311-
Add the following `TwoFactorRequest` method to `Identity/CookieAuthenticationStateProvider.cs` (paste the following code at the bottom of the class file):
311+
Add the following `TwoFactorRequestAsync` method to `Identity/CookieAuthenticationStateProvider.cs` (paste the following code at the bottom of the class file):
312312

313313
```csharp
314-
public async Task<TwoFactorResult> TwoFactorRequest(TwoFactorRequest twoFactorRequest)
314+
public async Task<TwoFactorResult> TwoFactorRequestAsync(TwoFactorRequest twoFactorRequest)
315315
{
316316
string[] defaultDetail =
317317
[ "An unknown error prevented two-factor authentication." ];
@@ -499,7 +499,7 @@ Replace the `Login` component. The following version of the `Login` component:
499499
500500
if (formResult.Succeeded)
501501
{
502-
var twoFactorResult = await Acct.TwoFactorRequest(new());
502+
var twoFactorResult = await Acct.TwoFactorRequestAsync(new());
503503
recoveryCodesRemainingMessage =
504504
$"You have {twoFactorResult.RecoveryCodesLeft} recovery " +
505505
"codes remaining.";
@@ -741,7 +741,7 @@ If 2FA is enabled, a button appears to disable 2FA.
741741
742742
protected override async Task OnInitializedAsync()
743743
{
744-
twoFactorResult = await Acct.TwoFactorRequest(new());
744+
twoFactorResult = await Acct.TwoFactorRequestAsync(new());
745745
}
746746
747747
protected override async Task OnAfterRenderAsync(bool firstRender)
@@ -773,18 +773,18 @@ If 2FA is enabled, a button appears to disable 2FA.
773773
private async Task Disable2FA()
774774
{
775775
twoFactorResult =
776-
await Acct.TwoFactorRequest(new() { ResetSharedKey = true });
776+
await Acct.TwoFactorRequestAsync(new() { ResetSharedKey = true });
777777
}
778778
779779
private async Task GenerateNewCodes()
780780
{
781781
twoFactorResult =
782-
await Acct.TwoFactorRequest(new() { ResetRecoveryCodes = true });
782+
await Acct.TwoFactorRequestAsync(new() { ResetRecoveryCodes = true });
783783
}
784784
785785
private async Task OnValidSubmitAsync()
786786
{
787-
twoFactorResult = await Acct.TwoFactorRequest(
787+
twoFactorResult = await Acct.TwoFactorRequestAsync(
788788
new()
789789
{
790790
Enable = true,

0 commit comments

Comments
 (0)