Topic-icon Login links not working in Google Chrome

Active Subscriptions:

None
12 years 1 month ago #43569 by Prastow
Hi,

Recently my login buttons for Google, Twitter and LinkedIn are not working anymore in Safari or Chrome (in Firefox and IE they are still working). Facebook login button is working in all browsers.

This is the code I use:
<a href="javascript:void(0)" onclick="jfbc.login.provider(\'facebook\');" class="btn btn-primary btn-block" style="background-color:#4c66a4;"><i class="fa fa-facebook fa-fw"></i>Facebook</a>
         <a id="sc_twlogin" href="javascript:void(0)" onclick="jfbc.login.provider(\'twitter\');" class="btn btn-primary btn-block" style="background-color:#2fc2ef;"><i class="fa fa-twitter fa-fw"></i>Twitter</a>
         <a id="sc_gologin" href="javascript:void(0)" onclick="jfbc.login.provider(\'google\');" class="btn btn-primary btn-block" style="background-color:#dd4b39;"><i class="fa fa-google-plus fa-fw"></i>Google</a>
         <a id="sc_lilogin" href="javascript:void(0)" onclick="jfbc.login.provider(\'linkedin\');" class="btn btn-primary btn-block" style="background-color:#4875b4;"><i class="fa fa-linkedin fa-fw"></i>LinkedIn</a>

The page doesn't generate any javascript errors and everything was working fine till recently.

Do more people have this problem and how do you solve this?

Kind Regards,
The topic has been locked.
Support Specialist
12 years 1 month ago #43577 by alzander
Usually, if a specific browser stops working with the social login buttons, it's due to an add-on / extension in your browser that's preventing the social networks from loading.

However, I just tested from your site and I'm seeing the same behavior. It's strange because, if I use the Developer Console in Chrome and type in "jfbc.login.provider('twitter');", I'm properly redirected to the authentication page as expected.

Here's what we'd recommend:
* Try moving the HTML you posted above to a custom HTML module that's *not* in the modal popup and see if it works there?
* Edit the /components/com_jfbconnect/includes/jfbconnect.js file. Around line 36, you'll see:
self.location = jfbc.base + 'index.php?option=com_jfbconnect&task=authenticate.login&provider=' + name + '&return=' + jfbc.return_url + '&' + jfbc.token + '=1';
That line *is* being executed on your page. I can tell from using the debugger in Chrome. For some reason self.location isn't working as expected. Can you try changing that to:
document.location and window.location to see if either has better results? Make sure you refresh your browser so that the updated file is properly loaded.

Let me know if either of those helps get you going as it will help us narrow things down either way.

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

None
12 years 1 month ago #43581 by Prastow
Hi,

Thanks for your reply. I have moved it to a custom HTML module, but when I click on a login button it redirects me to /undefined and I get a 500 internal server error??

I think something is indeed wrong with redirection, both document.location and window.location didn't help.

Prastow
The topic has been locked.
Support Specialist
12 years 1 month ago #43613 by alzander
The links on the page aren't working at all now because you removed the onclick=.. parameter in the link. Right now, the links look like:
<a class="btn btn-primary btn-block" style="background-color: #dd4b39;">Google</a>
That's a link without any href or onclick value set, which is why the undefined is showing. You'll need to update that to:
<a class="btn btn-primary btn-block" style="background-color: #dd4b39;" href="javascript:void(0)" onclick="jfbc.login.provider(\'google\');">Google</a>
Try that and then change the self.location to either document or window and let me know if that helps make a difference.

I'm still unsure what's happening, but the change above is definitely a step backward.

Thanks,
Alex
The topic has been locked.