Sha256: e56ee44d0eccc831ada8902fe3106dd4b92f48e86c4c4a637e9cab185e056c0b

Contents?: true

Size: 699 Bytes

Versions: 12

Compression:

Stored size: 699 Bytes

Contents

require 'devise_security_extension/hooks/session_limitable'

module Devise
  module Models
    # SessionLimited ensures, that there is only one session usable per account at once.
    # If someone logs in, and some other is logging in with the same credentials,
    # the session from the first one is invalidated and not usable anymore.
    # The first one is redirected to the sign page with a message, telling that 
    # someone used his credentials to sign in.
    module SessionLimitable
      extend ActiveSupport::Concern

      def update_unique_session_id!(unique_session_id)
        self.unique_session_id = unique_session_id

        save(:validate => false)
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
devise_security_extension-0.10.0 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.9.2 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.9.1 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.8.4 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.8.3 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.8.1 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.8.0 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.7.2 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.7.1 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.7.0 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.6.2 lib/devise_security_extension/models/session_limitable.rb
devise_security_extension-0.6.1 lib/devise_security_extension/models/session_limitable.rb