fix logic to force authenticated user to provide email address so it works in static rendering
This commit is contained in:
parent
dcf6f26792
commit
40abb2720e
|
@ -20,6 +20,13 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// force authenticated user to provide email address (email may be missing if using external login)
|
||||
if (PageState.User != null && PageState.User.IsAuthenticated && string.IsNullOrEmpty(PageState.User.Email) && PageState.Route.PagePath != "profile")
|
||||
{
|
||||
NavigationManager.NavigateTo(Utilities.NavigateUrl(PageState.Alias.Path, "profile", "returnurl=" + WebUtility.UrlEncode(PageState.Route.PathAndQuery)));
|
||||
return;
|
||||
}
|
||||
|
||||
// set page title
|
||||
if (!string.IsNullOrEmpty(PageState.Page.Title))
|
||||
{
|
||||
|
@ -83,13 +90,6 @@
|
|||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
// force authenticated user to provide email address (email may be missing if using external login)
|
||||
if (PageState.User != null && PageState.User.IsAuthenticated && string.IsNullOrEmpty(PageState.User.Email) && PageState.Route.PagePath != "profile")
|
||||
{
|
||||
NavigationManager.NavigateTo(Utilities.NavigateUrl(PageState.Alias.Path, "profile", "returnurl=" + WebUtility.UrlEncode(PageState.Route.PathAndQuery)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!firstRender)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(PageState.Page.HeadContent) && PageState.Page.HeadContent.Contains("<script"))
|
||||
|
|
|
@ -120,6 +120,7 @@ namespace Oqtane.Controllers
|
|||
filtered = new User();
|
||||
|
||||
// public properties
|
||||
filtered.SiteId = user.SiteId;
|
||||
filtered.UserId = user.UserId;
|
||||
filtered.Username = user.Username;
|
||||
filtered.DisplayName = user.DisplayName;
|
||||
|
|
Loading…
Reference in New Issue
Block a user