Fixed issue where page was not reloaded after login/logout
This commit is contained in:
@ -50,7 +50,7 @@
|
|||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
AuthStateProvider.NotifyAuthenticationChanged();
|
AuthStateProvider.NotifyAuthenticationChanged();
|
||||||
UriHelper.NavigateTo(NavigateUrl(""));
|
UriHelper.NavigateTo(NavigateUrl("", true));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -107,20 +107,6 @@ private async Task Refresh()
|
|||||||
}
|
}
|
||||||
if (site != null || reload == true)
|
if (site != null || reload == true)
|
||||||
{
|
{
|
||||||
user = null;
|
|
||||||
if (PageState == null || reload == true)
|
|
||||||
{
|
|
||||||
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
|
||||||
if (authState.User.Identity.IsAuthenticated)
|
|
||||||
{
|
|
||||||
user = await UserService.GetCurrentUserAsync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
user = PageState.User;
|
|
||||||
}
|
|
||||||
|
|
||||||
string path = new Uri(_absoluteUri).PathAndQuery.Substring(1);
|
string path = new Uri(_absoluteUri).PathAndQuery.Substring(1);
|
||||||
if (path.EndsWith("/")) { path = path.Substring(0, path.Length - 1); }
|
if (path.EndsWith("/")) { path = path.Substring(0, path.Length - 1); }
|
||||||
if (alias.Path != "")
|
if (alias.Path != "")
|
||||||
@ -135,6 +121,20 @@ private async Task Refresh()
|
|||||||
reload = true;
|
reload = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
user = null;
|
||||||
|
if (PageState == null || reload == true)
|
||||||
|
{
|
||||||
|
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||||
|
if (authState.User.Identity.IsAuthenticated)
|
||||||
|
{
|
||||||
|
user = await UserService.GetCurrentUserAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user = PageState.User;
|
||||||
|
}
|
||||||
|
|
||||||
if (PageState == null || reload == true)
|
if (PageState == null || reload == true)
|
||||||
{
|
{
|
||||||
pages = await PageService.GetPagesAsync(site.SiteId);
|
pages = await PageService.GetPagesAsync(site.SiteId);
|
||||||
|
@ -29,6 +29,6 @@
|
|||||||
{
|
{
|
||||||
await UserService.LogoutUserAsync();
|
await UserService.LogoutUserAsync();
|
||||||
AuthStateProvider.NotifyAuthenticationChanged();
|
AuthStateProvider.NotifyAuthenticationChanged();
|
||||||
UriHelper.NavigateTo(NavigateUrl(""));
|
UriHelper.NavigateTo(NavigateUrl("", true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user