fix logic to force authenticated user to provide email address so it works in static rendering
This commit is contained in:
		| @ -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")) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 sbwalker
					sbwalker