Copied to clipboard

Flag this post as spam?

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


  • djamel 4 posts 74 karma points
    Dec 09, 2022 @ 19:23
    djamel
    0

    Umbraco.MemberIsLoggedOn

    Hi

    I have a surface controller where a members' credentials are checked like the following:

     if (!Members.Login(vm.UserName, vm.Password))
            {
    
                ModelState.AddModelError("Login", "The username/password you provided is incorrect");
                return CurrentUmbracoPage();
            }
    
            if (!string.IsNullOrEmpty(vm.RedirectUrl))
            {
                return Redirect(vm.RedirectUrl);
            }
            return Redirect("/pages/home/")
    

    My issue is the Members.Login succeeds but Umbraco.MemberIsLoggedOn() returns false.

    And because of that the login page keeps showing instead of redirecting to the restricted page as if the user is not logged in.

    Umbraco version: 8.18.2

    I appreciate you help for those who had this kind of issue

Please Sign in or register to post replies

Write your reply to:

Draft