Craig100
07/03/2024, 11:43 AM@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
@using Microsoft.AspNetCore.Http.Extensions
@using Umbraco.Cms.Web.Common.Models
@using Umbraco.Cms.Web.Website.Controllers
@using Umbraco.Extensions
@{
    var isLoggedIn = Context.User?.Identity?.IsAuthenticated ?? false;
    var logoutModel = new PostRedirectModel();
    // You can modify this to redirect to a different URL instead of the current one
    logoutModel.RedirectUrl = "/";
}
@if (isLoggedIn)
{
    <div class="login-status" style="background-color: black; color: white;">
        <p>Welcome back <strong>@Context?.User?.Identity?.Name</strong>!</p>
        @using (Html.BeginUmbracoForm<UmbLoginStatusController>("HandleLogout", new { RedirectUrl = logoutModel.RedirectUrl }))
        {
            <button type="submit" class="btn btn-primary">Log out</button>
        }
    </div>
}
It looks like a leak in the Context.User. Any thoughts how to fix this?
Thanks.D_Inventor
07/04/2024, 5:40 AMCraig100
07/04/2024, 2:42 PMkdx-perbol
07/08/2024, 11:28 AMCraig100
07/09/2024, 6:40 PMCodeSharePaul
07/10/2024, 9:55 AMCraig100
07/12/2024, 3:26 PMA hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by