Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to make a service call from clientside to my api, which should update the currently logged in member.
The problem is, that after updating the members name, email and username, I cannot fetch the current member by using the Membership helper.
So when i try to use the membershipHelper.GetCurrentMember() after updating the member, it returns null.
I tried updating the member in several different way, to see if that would help, but with no luck.
using Umbraco.Core.Models;
IMember member = ApplicationContext.Services.MemberService.GetById(_memberHelper.GetCurrentMember().Id);member.Username = currentMember.Email;member.Email = currentMember.Email;member.Name = currentMember.Email;ApplicationContext.Services.MemberService.Save(member);
Using deprecated umbraco.cms.businesslogic.member;
Member member = Member.GetCurrentMember();member.LoginName = currentMember.Email;member.Text = currentMember.Email;member.Email = currentMember.Email;member.Save();
Updating profilemodel
var profileModel = _memberHelper.GetCurrentMemberProfileModel();profileModel.Name = currentMember.Email;profileModel.Email = currentMember.Email;profileModel.UserName = currentMember.Email; _memberHelper.UpdateMemberProfile(profileModel);
So these result in the currentmember, when trying to fetch the currentMember in another servicecall after updating the member successfully.
I've searched for a solution for hours. Any help is much appreciated :)
I would recommend logout after grabbing the object.
Update with info
prompt user to login again using new username etc.
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.
Continue discussion
Updating member through clientside calls to API
I'm trying to make a service call from clientside to my api, which should update the currently logged in member.
The problem is, that after updating the members name, email and username, I cannot fetch the current member by using the Membership helper.
So when i try to use the membershipHelper.GetCurrentMember() after updating the member, it returns null.
I tried updating the member in several different way, to see if that would help, but with no luck.
using Umbraco.Core.Models;
Using deprecated umbraco.cms.businesslogic.member;
Updating profilemodel
So these result in the currentmember, when trying to fetch the currentMember in another servicecall after updating the member successfully.
I've searched for a solution for hours. Any help is much appreciated :)
I would recommend logout after grabbing the object.
Update with info
prompt user to login again using new username etc.
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.
Continue discussion