Skip to content

Commit 01aaea0

Browse files
authored
Add a missing step (#36238)
1 parent 0a6414b commit 01aaea0

File tree

1 file changed

+13
-1
lines changed
  • aspnetcore/security/authentication/passkeys

1 file changed

+13
-1
lines changed

aspnetcore/security/authentication/passkeys/blazor.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to implement passkeys authentication in ASP.NET Core Blaz
55
ms.author: wpickett
66
monikerRange: '>= aspnetcore-10.0'
77
ms.custom: mvc
8-
ms.date: 09/10/2025
8+
ms.date: 10/20/2025
99
uid: security/authentication/passkeys/blazor
1010
zone_pivot_groups: implementation
1111
---
@@ -224,6 +224,18 @@ Replace the existing `Login` component with the following component and update t
224224

225225
[`Components/Account/Pages/Login.razor`](https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWebCSharp.1/Components/Account/Pages/Login.razor)
226226

227+
## Add a redirect method to the `IdentityRedirectManager` class
228+
229+
Add the following method to the `IdentityRedirectManager` class in `Components/Account/IdentityRedirectManager.cs`:
230+
231+
```csharp
232+
public void RedirectToInvalidUser(
233+
UserManager<ApplicationUser> userManager, HttpContext context) =>
234+
RedirectToWithStatus("Account/InvalidUser",
235+
$"Error: Unable to load user with ID '{userManager.GetUserId(context.User)}'.",
236+
context);
237+
```
238+
227239
## Create passkey management pages for adding and renaming passkeys
228240

229241
Add the following `Passkeys` component for managing passkeys and update the `BlazorWebCSharp._1.Data` namespace to match the app (for example: `Contoso.Components.Account.Data`):

0 commit comments

Comments
 (0)