- ABP Framework version: v7.1.0
- UI type: Blazor WASM
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): no
- Exception message and stack trace:
- Steps to reproduce the issue:"
- Deployed to Azure App Services
This is a follow-up for #4363 and #4503.
First I want to mention that my application is closed to be deployed in PROD. So I cannot just start over with other tech stack.
The application is fully updated with latest ABP Nuget and NPM packages and its deployed to Azure.
The problem is that ICurrentUser, or AuthState is not available after login, only after the page is refreshed.
This in turn affects if the menu is rendered or not. In my case I need to display some menus / submenus based on various roles or other user related properties.
In the first ticket opened it was a problem with the LeptonXTheme. I was instructed to wait for 2.0 release and it will work. Didn't work.
I also shared the project with the support team, but to no avail. Last recommendation was to publish a new blazor wasm template to Azure. I cannot do that as I am in the process of delivering it.
My question still stands: why I don't get the current user after the login in the menu contributor and why after the page refresh is working and why on local dev is working? Do the tech guys managed to publish a Blazor WASM app to Azure and reproduce this? It is the most frustrating problem I ever encountered.
I really need help. I can share the solution to inspect it again.
Tks a lot!
12 Answer(s)
-
0
hi
Have you used Lepton packages above 2.0.3? The latest is 2.0.5.
-
0
-
0
hi
Let me confirm by zoom
https://us05web.zoom.us/j/82688415066?pwd=YnFxK2tETWdEVW8rT3VCOWhFeG5aZz09
-
0
hi
Please add below to your Index page:
[Inject] protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; set; } protected override async Task OnInitializedAsync() { ApplicationConfigurationChangedService.Changed += ApplicationConfigurationChanged; } private async void ApplicationConfigurationChanged() { // Check currentUser and other info here. // Write info to logs. await InvokeAsync(StateHasChanged); }
-
0
I see that a new
ApplicationConfiguration
request has been sent, but your menu has not been re-rendered. -
0
-
0
You can register this event in any component to listen to the successful login or logout event.
-
0
You can also use a hacker way to solve problems temporarily:
Refresh the current page in your Index page and pass a parameter to the Index to prevent unlimited loop refresh.
-
0
Will try your advices and come back with a feedback.
Tks a lot!
-
0
: )
-
0
Hi!
Partially and temporary solved by refreshing the Index after login.
I would suggest that your tech guys to publish a Blazor WASM app to Azure and find the culprit there.
Please let this ticket open until you guys can replicate the problem in Azure environment.
Is it possible?
-
0
sure.
What is your azure environment? Can you introduce it?