Module: SyncAttrWithAuth0::Model::ClassMethods

Defined in:
lib/sync_attr_with_auth0/model.rb

Instance Method Summary collapse

Instance Method Details

#sync_attr_with_auth0(options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/sync_attr_with_auth0/model.rb', line 9

def sync_attr_with_auth0(options = {})
  class_attribute :auth0_sync_options

  # class_attribute :auth0_uid_att
  # class_attribute :auth0_name_att
  # class_attribute :auth0_email_att
  # class_attribute :auth0_password_att
  # class_attribute :auth0_email_verified_att
  # class_attribute :auth0_connection_name
  # class_attribute :auth0_sync_atts

  merge_default_options(options)

  # self.auth0_uid_att = _options[:uid_att]
  # self.auth0_name_att = _options[:name_att]
  # self.auth0_email_att = _options[:email_att]
  # self.auth0_password_att = _options[:password_att]
  # self.auth0_email_verified_att = _options[:auth0_email_verified_att]
  # self.auth0_connection_name = _options[:auth0_connection_name]
  # self.auth0_sync_atts = _options[:auth0_sync_atts].collect(&:to_s)

  after_validation :validate_email_with_auth0
  after_create :create_user_in_auth0
  after_update :sync_attr_with_auth0
end