Module: AuthlogicFacebookConnect::Session::Config

Defined in:
lib/authlogic_facebook_connect/session.rb

Instance Method Summary collapse

Instance Method Details

#facebook_skip_new_user_creation(value = nil) ⇒ Object Also known as: facebook_skip_new_user_creation=

Should a new user creation be skipped if there is no user with given facebook uid?

The default behavior is not to skip (hence create new user). You may want to turn it on if you want to try with different model.

  • Default: false

  • Accepts: Boolean



57
58
59
# File 'lib/authlogic_facebook_connect/session.rb', line 57

def facebook_skip_new_user_creation(value = nil)
  rw_config(:facebook_skip_new_user_creation, value, false)
end

#facebook_uid_field(value = nil) ⇒ Object Also known as: facebook_uid_field=

What user field should be used for the facebook UID?

This is useful if you want to use a single field for multiple types of alternate user IDs, e.g. one that handles both OpenID identifiers and facebook ids.

  • Default: :facebook_uid

  • Accepts: Symbol



36
37
38
# File 'lib/authlogic_facebook_connect/session.rb', line 36

def facebook_uid_field(value = nil)
  rw_config(:facebook_uid_field, value, :facebook_uid)
end

#facebook_user_class(value = nil) ⇒ Object Also known as: facebook_user_class=

Class representing facebook users we want to authenticate against

  • Default: klass

  • Accepts: Class



45
46
47
# File 'lib/authlogic_facebook_connect/session.rb', line 45

def facebook_user_class(value = nil)
  rw_config(:facebook_user_class, value, klass)
end

#facebook_valid_user(value = nil) ⇒ Object Also known as: facebook_valid_user=

Should the user be saved with our without validations?

The default behavior is to save the user without validations and then in an application specific interface ask for the additional user details to make the user valid as facebook just provides a facebook id.

This is useful if you do want to turn on user validations, maybe if you just have facebook connect as an additional authentication solution and you already have valid users.

  • Default: true

  • Accepts: Boolean



23
24
25
# File 'lib/authlogic_facebook_connect/session.rb', line 23

def facebook_valid_user(value = nil)
  rw_config(:facebook_valid_user, value, false)
end