[Facebooker-talk] FB Notify URLs and ensure_authenticated_to_facebook

Mike Mangino mmangino at elevatedrails.com
Wed Nov 5 21:49:08 EST 2008


On Nov 5, 2008, at 5:37 PM, Mike Summers wrote:

> Didn't work, most likely pilot error on my part. This is the code:
>
> class PostController < ApplicationController
>   include Facebooker::Rails::Controller
>   protect_from_forgery(:only => [:create, :update, :destroy])
>
>   def add
>     STDERR.puts("post.add")
>     STDERR.flush
>     redirect_to("#{AppRoot}")
>   end
>
>   def remove
>     STDERR.puts("post.remove")
>     STDERR.flush
>     #redirect_to("#{AppRoot}")
>   end
>
>   def authorize
>     result = set_facebook_session
>     STDERR.puts("post.authorize: set_facebook_session-  
> #{result.inspect}")
>     STDERR.flush
>      
> EventPublisher 
> .deliver_authorize_event(session[:facebook_session].user)
>     redirect_to("#{AppRoot}")
>   end
> end
>
> set_facebook_session is returning nil. The controller shows the full  
> compliment of fb_sig_* parameters, their values look good.
>

Sorry, try looking at the value of facebook_session after calling  
set_facebook_session. It is a filter that should make the  
facebook_session variables available.

Mike


> Am I including the Controller's code correctly?
>
> Thanks for the help.
>
> Mike Summers wrote:
>>
>> I'll give it a try and report back.
>>
>> Thanks!
>>
>> Mike Mangino wrote:
>>>
>>>
>>> On Nov 5, 2008, at 4:09 PM, Mike Summers wrote:
>>>
>>>> Is there any resolution to this? I'm having a similar problem  
>>>> with my post authorize controller method.
>>>>
>>>> If I don't use ensure_* there's no facebook_session, if I use  
>>>> ensure_* I get redirected away :-(
>>>
>>> There is a set_facebook_session filter that will try to set the  
>>> session without a redirect. Does that work for you?
>>>
>>> Mike
>>>
>>>>
>>>>
>>>> --Mike
>>>>
>>>
>>> -- 
>>> Mike Mangino
>>> http://www.elevatedrails.com
>>>
>>>
>>>
>>>
>>
>> _______________________________________________
>> Facebooker-talk mailing list
>> Facebooker-talk at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/facebooker-talk
>>

--
Mike Mangino
http://www.elevatedrails.com





More information about the Facebooker-talk mailing list