Fix Blazor WebApp back to impersonator not using form post #21675

Back

Summary

Fixes #21668 - Blazor WebApp - Returning back after impersonation gets an error.

Root Cause

The impersonatorMenuItem variable was null after adding a new menu item in AccountBlazorUserMenuContributor.cs, so UseComponent<ImpersonationComponent>() was never called. This caused the "Back to my account" button to do a GET request instead of POST, resulting in the "client_id is missing" error from OpenIddict.

Fix

Store the newly created menu item in the impersonatorMenuItem variable before adding it to the menu, then call UseComponent<ImpersonationComponent>() on it.

Changes

  • abp/account/src/Volo.Abp.Account.Pro.Public.Blazor.Shared/AccountBlazorUserMenuContributor.cs

How to test?

Option A

  • Convert your existing project to local referrence and it'll be working

Option B

  • Create a project with Local Reference and it'll be working
Version
10.2.0-rc.1
Release Date
24 February, 2026
Labels
abp-module-account ui-blazor
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.