Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V13: Clear username cache #17815

Open
wants to merge 2 commits into
base: release/13.6
Choose a base branch
from

Conversation

Zeegaan
Copy link
Member

@Zeegaan Zeegaan commented Dec 13, 2024

Notes

  • There was a bug where you could still login as a member for a little while, after you've deleted the member.
    This was caused by the userNameCache not being cleared in the member repository.
  • Clears the user name cache in the MemberRepository when members are updated/deleted

How to test

  • Create RegisterMember.cshtml partial view from snippet
  • Create Login.cshtml partial view from snippet
  • Create LoginStatus.cshtml partial view from snippet
  • Create a doc type ContentPage and in its template add:
@using Umbraco.Cms.Web.Common.PublishedModels;
@using Umbraco.Cms.Core.Services;
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<ContentModels.ContentPage>
@inject IMemberService MemberService
@using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
@{
	Layout = null;
	var isLoggedIn = Context.User?.Identity?.IsAuthenticated ?? false;
}

@if (!isLoggedIn)
{
    @await Html.PartialAsync("RegisterMember")
    <hr/>
    <br/>
    @await Html.PartialAsync("Login")
}
else
{
    @await Html.PartialAsync("LoginStatus")
}
  • Register a member
  • Logout
  • Delete the member
  • Try to login ---> This should fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant