0

I am using the facebooker authlogic plugin. I have it working pretty well now. However, any attempt to set the email address in User.before_connect(facebook_session) is causing a Apache to throw the following error:

Premature end of script headers: person_session, referer:

(person_session is my user_session).

Here is the code for before_connect:

def before_connect(facebook_session) self.name = facebook_session.user.name self.login=facebook_session.user.first_name self.points=Person.default_points

 Rails.logger.debug("*********email: "+facebook_session.user.email)
 self.email=facebook_session.user.email

end

Note that the email address that is logged before the error occurs is valid.

My guess is that adding the '@' is causing it to fail. Another possibility is that it's trying to do some validation of the email address which causes the http error.

Any ideas would be appreciated.

Thanks.

galactikuh
  • 765
  • 8
  • 18
  • As a workaround, I've created a field in my User model called temp_email. I set that instead in before_connect and then set it permanently in my person_session_controller. So this means that it's something to do with validation (I'm guessing). Still would be nice to have a "real" fix. – galactikuh Aug 17 '10 at 22:06

1 Answers1

0

Apparently you can also get the email from the facebook_session in your application. But you have to put the following in your application_controller to access the facebook_session (this was non-obvious and only discovered from another person's obscure post):

before_filter :set_facebook_session helper_method :facebook_session

galactikuh
  • 765
  • 8
  • 18