Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • DitlevHB 6 posts 66 karma points
    Mar 26, 2015 @ 23:05
    DitlevHB
    1

    Updating memberprofile (loginname not updated)

    ** I figured it out. I just had to use memberservice instead of the profilemodel. Not sure why it doesn't update the username/loginame upon updating memberprofile.

    I'm trying to update a currently logged in member, but the loginname/username is not updated in the backoffice.

    var profileModel = _memberHelper.GetCurrentMemberProfileModel();

    profileModel.Name = currentMember.Email;
    profileModel.Email = currentMember.Email;
    profileModel.UserName = currentMember.Email;

    _memberHelper.UpdateMemberProfile(profileModel);

    As far as i know, the username property should reflect the loginname?

    I would like to add, that i also tried to update the member directly with the memberservice, but that results in a logout of the currentmember, which i am not interested in.

    I've searched for a few hours with no luck. Help is much appreciated :)

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 9x admin c-trib
    Mar 28, 2015 @ 16:52
  • DitlevHB 6 posts 66 karma points
    Mar 29, 2015 @ 00:38
    DitlevHB
    0

    Yes i have and the issue persists. 

    It seems, that it is not possible to fetch current member from the same umbracocontext with memberHelper, when saving the user with memberservice. It somewhat makes sense, that the currentMember won't be available in the current context after updating the member, as the currentMember would no longer exist.

    I've made another post addressing the other issue, with what i've attempted.

    https://our.umbraco.org/forum/developers/api-questions/63589-Updating-member-through-clientside-calls-to-API

  • 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.

Please Sign in or register to post replies