Black Friday / Cyber Monday Special - 10% Off - Use "CYBER10" at checkout!

Topic-icon FB.login() called when user is already connected.

Hi, our developers have tried all the possible fixes for that and its not working on your website. Below is the error that we are getting on our site:

sdk.js?hash=15432deeed4ab565039fa469ed16d3f9&ua=modern_es6:52 FB.login() called when user is already connected.
FB.login() called when user is already connected.

We have deployed the same plugin on various instances to test and have found it working perfect with the same facebook credentials. There is either a server restriction or you have such data settings in the website that prevents the Facebook API to work.

I've also attached here a screenshot of the chrome console showing multiple jfbconnect errors.

The site is linuxsecurity.com. What more can we do to troubleshoot this? It has been going on for months with our developers being unable to identify the problem.
The topic has been locked.
Support Specialist
2 years 6 months ago #65359 by alzander
The jfbc errors on page load are caused because our Javascript library file:
<script src="/components/com_jfbconnect/includes/jfbconnect.js?v=6" type="text/javascript">
Is being loaded after some inline Javascript that references the code from that file:
<script type="text/javascript">jfbc.login.logout_facebook = false; 
jfbc.base = ...
</script>
Can you force whatever caching or optimization extension you're using to not re-order our jfbconnect.js file to the bottom of the page?

Once that's done, the console errors should be gone and may fix your "login already called ... " error, but I'm not sure until the above gets fixed.

Either way, we'll work to get you going, so keep us posted on progress.

Thanks,
Alex
The topic has been locked.
2 years 6 months ago #65360 by dwreski
We've disabled the cache and it still does not work. The quote I received from the developer was:

"SpeedCache plugin was disabled along wit the default caching of Joomla. After disabling it the Javascripts ordering was corrected but it still din't work"

Can we provide the access credentials and ask you to investigate directly?
The topic has been locked.
2 years 6 months ago #65363 by dwreski
Hi, just looking for an update here. What more can we do to troubleshoot this?
The topic has been locked.
Support Specialist
2 years 6 months ago #65364 by alzander
I apologize for the delay. We'd definitely like to investigate further to help get you going. To do that, please:
* Let us know exactly how to reproduce the error. I don't see the error on the site when I just go to it. Please let us know a specific page to go to, what steps to take and when the error should show up in the console (along with any other details you can provide)
* I see the 'jfbc not found' javascript errors are back. Please fix those. Authentication will not work with those errors.

Once the above is ready, we'll dig in.

Thanks,
Alex
The topic has been locked.
2 years 6 months ago - 2 years 6 months ago #65369 by dwreski
We have re-entered the facebook app id and have disabled all the cache plugin now. This includes Speedcache, System async and defer, and joomla core gzip and of them have been disabled.

Methods to reproduce the error:
1) Click the Login button on the top-right side
2) Then, Click to Facebook button at the bottom of opened popup.
3) Signup with any of the facebook account and you will see the issue

Please also see error console attachment.
File Attachment:
Last edit: 2 years 6 months ago by dwreski.
The topic has been locked.
Support Specialist
2 years 6 months ago #65370 by alzander
Something on your site still re-ordering the scripts on your page, which is causing the red javascript console messages you see in your picture. Above, you mentioned:

After disabling it the Javascripts ordering was corrected but it still din't work"

Please disable whatever is reordering the Javascripts. Alternatively, most optimization or re-ordering extensions allow you to set exclusions to prevent certain files from being re-ordered. If so, set an exclusion for the jfbconnect.js file so it's not included at the bottom of the page and is in the head section where it needs to be.

Once that's fixed, we'll gladly investigate why authentication isn't working if there are still issues.

Thanks,
Alex
The topic has been locked.
2 years 6 months ago #65423 by dwreski

alzander wrote: Something on your site still re-ordering the scripts on your page, which is causing the red javascript console messages you see in your picture. Above, you mentioned:

After disabling it the Javascripts ordering was corrected but it still din't work"

Please disable whatever is reordering the Javascripts. Alternatively, most optimization or re-ordering extensions allow you to set exclusions to prevent certain files from being re-ordered. If so, set an exclusion for the jfbconnect.js file so it's not included at the bottom of the page and is in the head section where it needs to be.

Once that's fixed, we'll gladly investigate why authentication isn't working if there are still issues.

Thanks,
Alex

We're still having difficulty. The developers have confirmed they have disabled whatever was reordering the javascripts and it still is not working properly.

What more can we do to fix this?
The topic has been locked.
Support Specialist
2 years 6 months ago #65428 by alzander
I just tried to login on your site, but the Facebook login button is missing. I can try to force the login by calling the Javascript directly, but when I do, I get the following error message in the console:

FB.login() called before FB.init().

That is the correct message because right now, the Facebook API key is not set. Without the API key, login cannot happen at all.

Can you re-enter the API and Secret keys in JFBConnect and try again? Please let me know the error message that you get if you run into issues.

The other option I'd suggest, even temporarily, is to set the "Show login credentials in popup" setting in JFBConnect to "No". That will bypass all Javascript during the authentication process and redirect the user to Facebook to login and then back to your site when they do. Even if you don't like that login flow, it should work and get you going while we resolve the cause of the Javascript login issue.

Thanks,
Alex
The topic has been locked.
Social Stream
Hide. Seek. Play!

Countdown Hide & Seek Game

Countdown, the new hide & seek toy, is available now! Designed and developed by the founders of SourceCoast, it's the perfect toy to get your kids moving at all ages.

Learn More About the Hide and Seek Toy