Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor, .Net 8 and Global Interactivity issue with Identity

$
0
0

I have been playing around with the new .Net 8 Blazor templates and ran into a problem with Identity and setting a global InteractiveServer render mode. The change I made was in the App.Razor file to the :

<Routes @rendermode="InteractiveServer" />

The reason I added this was because I was also attempting to get MudBlazor integrated and this was required for it to run properly (as far as I could tell at least). MS does list the ability to do this via docs as well so appears to be a legitimate choice to make to set this global render mode.

The issue I then faced was with any page using the AccountLayout component e.g. Login, Register, ResetPassword etc because it loops on this part:

if (HttpContext is null){    // If this code runs, we're currently rendering in interactive mode, so there is no HttpContext.    // The identity pages need to set cookies, so they require an HttpContext. To achieve this we    // must transition back from interactive mode to a server-rendered page.    NavigationManager.Refresh(forceReload: true);}

As it's globally set it's always hit so goes into an endless navigation loop. I attempted to set the account layout and/or account pages to use a rendermode of null, default, static etc but they don't seem to be valid options nor can I find any examples of anyone doing this.

So my question is, does anyone know of a way to either set default/static on a component for render mode OR know of a way to get MudBlazor working in .net 8 project without using global interactive mode? I have obviously tried setting the rendermode to interactive on relevant pages using mudblazor.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>