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

Merged
merged 2 commits into from
Dec 16, 2024
Merged

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

@elit0451 elit0451 merged commit 34f09fa into release/13.6 Dec 16, 2024
14 checks passed
@elit0451 elit0451 deleted the v13/hotfix/clear-username-cache branch December 16, 2024 06:18
elit0451 pushed a commit that referenced this pull request Dec 16, 2024
* Clear member username cache on delete

* Also refresh cache on update
elit0451 pushed a commit that referenced this pull request Dec 16, 2024
* Clear member username cache on delete

* Also refresh cache on update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants