mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
25 lines
647 B
Ruby
25 lines
647 B
Ruby
module SharedUser
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
devise :database_authenticatable, :confirmable, :lockable, :recoverable,
|
|
:registerable, :rememberable, :timeoutable, :token_authenticatable,
|
|
:trackable, :validatable, :omniauthable
|
|
|
|
attr_accessor :other_key
|
|
|
|
# They need to be included after Devise is called.
|
|
extend ExtendMethods
|
|
end
|
|
|
|
module ExtendMethods
|
|
def new_with_session(params, session)
|
|
super.tap do |user|
|
|
if data = session["devise.facebook_data"]
|
|
user.email = data["email"]
|
|
user.confirmed_at = Time.now
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|