Fix #5649: handle not found request.
This commit is contained in:
@@ -29,6 +29,8 @@ namespace Oqtane.UI
|
||||
public bool Refresh { get; set; }
|
||||
public bool AllowCookies { get; set; }
|
||||
|
||||
public int? StatusCode { get; set; }
|
||||
|
||||
public List<Page> Pages
|
||||
{
|
||||
get { return Site?.Pages; }
|
||||
@@ -63,7 +65,8 @@ namespace Oqtane.UI
|
||||
IsInternalNavigation = IsInternalNavigation,
|
||||
RenderId = RenderId,
|
||||
Refresh = Refresh,
|
||||
AllowCookies = AllowCookies
|
||||
AllowCookies = AllowCookies,
|
||||
StatusCode = StatusCode
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,9 @@
|
||||
|
||||
// verify user is authenticated for current site
|
||||
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||
if (authState.User.Identity.IsAuthenticated && authState.User.Claims.Any(item => item.Type == Constants.SiteKeyClaimType && item.Value == SiteState.Alias.SiteKey))
|
||||
if (authState.User.Identity.IsAuthenticated
|
||||
&& authState.User.Claims.Any(item => item.Type == Constants.SiteKeyClaimType && item.Value == SiteState.Alias.SiteKey)
|
||||
&& PageState.StatusCode != (int)HttpStatusCode.NotFound)
|
||||
{
|
||||
// get user
|
||||
var userid = int.Parse(authState.User.Claims.First(item => item.Type == ClaimTypes.NameIdentifier).Value);
|
||||
@@ -337,6 +339,7 @@
|
||||
IsInternalNavigation = _isInternalNavigation,
|
||||
RenderId = renderid,
|
||||
Refresh = false,
|
||||
StatusCode = PageState?.StatusCode,
|
||||
AllowCookies = _allowCookies.GetValueOrDefault(true)
|
||||
};
|
||||
OnStateChange?.Invoke(_pagestate);
|
||||
|
||||
Reference in New Issue
Block a user