Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

willrossi's Facebook Connect - keeps refreshing after login?


Reply


4 Posts   2494 Views

Avatar
nimeso

Community Member, 17 Posts

16 October 2010 at 1:52pm

Hi all,

Firstly thanks for all the great work Will!

I've successfully installed the latest version of your module and latest Silverstripe on my computer at work and have just set it up at home and am getting the most annoying issue!

1. The FB 'login' button works fine and opens the login window a-ok.
2. Once I've logged in it closes the pop up but then keeps repeating the

window.fbAsyncInit = function() {
FB.init({
      appId : '159716150722805',
      session : null,
      status : true,
      cookie : true,
      xfbml : true
});

   FB.Event.subscribe('auth.login', function() {
      window.location.reload();
   });
};

function and continuously trys to reload the page.... endless loop?

I've now tried two clean installs on my local host and tried a heap of stuff to get it sorted but have had no luck at all. kinda important I get this working or my boss is gonna skin me on Monday! lol

Cheers for all your help Will

Jamie

Avatar
Willr

Forum Moderator, 5513 Posts

16 October 2010 at 2:52pm

Session shouldn't be null after logging in. You might want to put a debug statement inside the catch() statement to see any of the errors its generating.

Note that the app url is a setting on the facebook settings page and that has to match the URL so if you're on a different URL at home that would cause it to fail.

Avatar
nimeso

Community Member, 17 Posts

16 October 2010 at 7:11pm

Will, you are a true angle I owe you a beer (and take some time off... it's sat!).
Thanks you heaps for pointing me in the right direction. should have spotted that. I'll let you know how I get on.

Avatar
Capt. Morgan

Community Member, 30 Posts

26 January 2011 at 10:18am

Edited: 29/01/2011 11:53am

I'm curious though how you set the Application URL in the settings when you're testing your implementation locally. http://localhost?
Doesn't seem to do it for me, then I get the endless refresh as nimeso told about. Leaving it black will cause the auth popup to protest..

[Solved]
I'm running my app locally on port 2000 so I of course just had to set "http://localhost:2000/" as my site URL and the eternal redirect loop stopped.

Now I just have to figure out why my session won't work..