Sha256: 9a619603c42b351649dce09ced9d009aca084bfda8850a1f12566fbfb53a430b

Contents?: true

Size: 801 Bytes

Versions: 7

Compression:

Stored size: 801 Bytes

Contents

# frozen_string_literal: true

module SharedUser
  extend ActiveSupport::Concern

  included do
    devise :database_authenticatable, :confirmable, :lockable, :recoverable,
           :registerable, :rememberable, :timeoutable,
           :trackable, :secure_validatable, :omniauthable, :validatable, password_length: 7..72,
           reconfirmable: false

    attr_accessor :other_key

    # They need to be included after Devise is called.
    extend ExtendMethods
  end

  def raw_confirmation_token
    @raw_confirmation_token
  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.zone.now
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
devise-security-0.16.0 test/dummy/lib/shared_user.rb
devise-security-0.15.0 test/dummy/lib/shared_user.rb
devise-security-0.14.3 test/dummy/lib/shared_user.rb
devise-security-0.14.2 test/dummy/lib/shared_user.rb
devise-security-0.14.1 test/dummy/lib/shared_user.rb
devise-security-0.14.0 test/dummy/lib/shared_user.rb
devise-security-0.14.0.rc1 test/dummy/lib/shared_user.rb