Hello everybody :)
So we have this Umbraco 8.18.4 website where we found an issue regarding members that were created through the member service.
Initially, after the member is created using the API, property values are added as expected.
But if I perform a login using Members.Login(username, password), the property values are removed right after that.
I have included a screencast that explains the problem:
https://vimeo.com/745387149/0c6d075bdd
And my controller used for both creating the member and performing login looks like this. What are we doing wrong? Hope someone can help :)
public class MemberController : UmbracoApiController
{
private readonly IMemberService _memberService;
private readonly string email = "user@domain.com";
public MemberController(IMemberService memberService)
{
_memberService = memberService;
}
[HttpGet]
public void Login()
{
Members.Login(email, email);
}
[HttpPost]
public void Create()
{
string memberTypeAlias = "Member";
IMember member = _memberService.CreateMemberWithIdentity(email, email, email, memberTypeAlias);
member.SetValue("customerNo", "d20001000");
_memberService.SavePassword(member, email);
_memberService.Save(member, false);
}
}
Okay, so after reaching out to Umbraco HQ I realized that the _memberService.Save(member, false); line needed to be changed to just _memberService.Save(member);
In terms raising events :) Now the property is not removed on login.
Member property values disappear after login
Hello everybody :) So we have this Umbraco 8.18.4 website where we found an issue regarding members that were created through the member service. Initially, after the member is created using the API, property values are added as expected. But if I perform a login using Members.Login(username, password), the property values are removed right after that. I have included a screencast that explains the problem: https://vimeo.com/745387149/0c6d075bdd
And my controller used for both creating the member and performing login looks like this. What are we doing wrong? Hope someone can help :)
How are you adding you custom property (customerNo)?
I just created the property using the BackOffice UI on the default member type on this path: /umbraco#/settings/memberTypes/edit/1044
Okay, so after reaching out to Umbraco HQ I realized that the _memberService.Save(member, false); line needed to be changed to just _memberService.Save(member); In terms raising events :) Now the property is not removed on login.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.