Sha256: 7e3883205fc1831169305362703d0ed44934a802e9031bfbbef7f2fa1f8a97bb
Contents?: true
Size: 717 Bytes
Versions: 4
Compression:
Stored size: 717 Bytes
Contents
# frozen_string_literal: true require 'devise-security/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
4 entries across 4 versions & 1 rubygems