Topic-icon SCLogin not following user mappin

Active Subscriptions:

None
11 years 2 months ago #31065 by johnnydement
When I log via FB, the user connect button dissapears, but:

  • If while logged i reload the page, it is there
  • If I log using Jª user details, it is there
  • If I log via LinkedIn, it is there

  • Notice this only happens with FB button, LinkedIn one does not appear again after linking to user

    If I check JFBC usermap, my user is corfrectly maped
    The topic has been locked.
    Support Specialist
    11 years 2 months ago #31074 by alzander
    Not sure. It sounds like JFBConnect isn't detecting the user properly. That can be caused by a few things, usually expired or missing authentication tokens which Facebook provides.

    Can you send us details of the site so we can see what's happening on the front-end? If possible, super admin credentials would help as well to check how you have things configured.

    Also, has this site run with earlier versions of JFBConnect? Did you have the issues then, or did this just start after the v5.0 upgrade?

    Thanks,
    Alex
    The topic has been locked.
    Active Subscriptions:

    None
    11 years 2 months ago #31078 by johnnydement

    alzander wrote: Also, has this site run with earlier versions of JFBConnect? Did you have the issues then, or did this just start after the v5.0 upgrade?


    No, it's a new site I'm working on done in J3, so I had to wait for a comatible release ;)

    It's a clean JFCB install

    I send you details in a PM

    Thanks!
    The topic has been locked.
    Active Subscriptions:

    None
    11 years 2 months ago #31148 by johnnydement

    alzander wrote: Can you send us details of the site so we can see what's happening on the front-end? If possible, super admin credentials would help as well to check how you have things configured.


    Could you give a look? ;)
    The topic has been locked.
    Support Specialist
    11 years 2 months ago #31160 by alzander
    Johnny,
    Sorry for the delay. I just got into your site and tested a bit.

    I wasn't able to recreate the issue of reloading the page to see the Connect this account button when I had connected with JFBConnect. However, I could see the Connect button when logging in with Joomla credentials. I think this is likely due to an optimization in the latest release to try to speed up page loads for guests. Basically, we don't load some Facebook features for guests if you don't have Automatically log Facebook users in. Without that extra call, the FB Javascript isn't notifying us that a specific user is logged in already, so JFBConnect doesn't see anyone, and therefore it asks if they want to connect.

    Honestly, the SCLogin module shouldn't present that option if the user has ever connected before (not if they just currently aren't logged into Facebook), so it seems like there's a logic issue with what we're doing.

    Please test again for the cConnect button showing after you login with Facebook. We were testing on the JomSocial home page with the site Online. We'll look into a modification of the SCLogin module to hide the connect button if the user has ever connected, regardless of if they're logged into Facebook at that moment.

    Thanks,
    Alex
    The topic has been locked.
    Active Subscriptions:

    None
    11 years 2 months ago #31161 by johnnydement

    alzander wrote: lease test again for the cConnect button showing after you login with Facebook. We were testing on the JomSocial home page with the site Online. We'll look into a modification of the SCLogin module to hide the connect button if the user has ever connected, regardless of if they're logged into Facebook at that moment.


    I already tried it, when I login through facebook, the button does not appear :)

    BUT, if after that login, I ctrl+r the page, it reappears :(
    The topic has been locked.
    Support Specialist
    11 years 2 months ago #31188 by alzander
    I just tested again, and I can't recreate that problem. Not saying it doesn't exist, I do believe you. When I tested this last time, I logged in on the home page. I hit ctrl+r a few times and then navigated to a few different pages. Each time, I checked the login drop down and things were fine.

    Can you let me know:
    * What browser you're using?
    * Try with another FB user and see if you have the same problem.
    * Does this happen on every page that you login from, or just specific ones.
    * Can you try switching your template to a Joomla-standard one and try again?

    Thanks,
    Alex
    The topic has been locked.
    Active Subscriptions:

    None
    11 years 2 months ago #31193 by johnnydement
    I'm gonna try recording a video as I just opened the site, and jy JConnect button is there ;)

    Gimme some minutes
    The topic has been locked.
    Active Subscriptions:

    None
    11 years 2 months ago #31195 by johnnydement

    alzander wrote: Can you let me know:
    * What browser you're using?
    * Try with another FB user and see if you have the same problem.
    * Does this happen on every page that you login from, or just specific ones.
    * Can you try switching your template to a Joomla-standard one and try again?


    1.- Chrome
    2- as the site is offline I have just logged from OFFLINE page :P
    3- Tried with protostar in the video with same result ;)

    [youtube]2Xn-bxkQBDw[/youtube]
    The topic has been locked.
    Support Specialist
    11 years 2 months ago #31247 by alzander
    Johnny,
    The problem is pretty much what I described above. Your account is actually 'linked', but SCLogin only checks if your user is 'mapped' in JFBConnect *AND* currently logged into Facebook. Since your site is in Offline mode, that throws another monkey wrench into things.

    As we mentioned above, and definitely seeing it from your video, the problem is:

    the SCLogin module shouldn't present that option if the user has ever connected before (not if they just currently aren't logged into Facebook), so it seems like there's a logic issue with what we're doing.

    If you're up for implementing and testing a quick change, we'd love your feedback. Please edit the /modules/mod_sclogin/helper.php file. Around line 340, you'll see:
    function getJLinkedConnectButton()
        {
            $buttonHtml = "";
            if (!$this->jlinkedLibrary->getMappedLinkedInUserId())
            {
    Change that to:
    function getJLinkedConnectButton()
        {
            $buttonHtml = "";
            $userMapModel = new JFBConnectModelUserMap();
            $jUser = JFactory::getUser();
    
            $fbMapping = $userMapModel->getFacebookUserId($jUser->get('id'));
            if (!empty($fbMapping))
            {
    That should simply check if the user has any mapping in Joomla to a Facebook user. Not if they have a mapping and are currently logged in. The code hasn't been tested, I just wrote it, but it looks right. Let me know how it goes, please.

    Best of luck, and thanks for the report. I can see adding this to an update of the SCLogin module in the future due to the obvious confusion it's current check can cause.

    Thanks,
    Alex
    The topic has been locked.