A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.rubydoc.info/gems/devise/Devise/Models/Timeoutable below:

Timeoutable – Documentation for devise (4.9.4) – RubyDoc.info

Module: Devise::Models::Timeoutable
Extended by:
ActiveSupport::Concern
Defined in:
lib/devise/models/timeoutable.rb
Overview

Timeoutable takes care of verifying whether a user session has already expired or not. When a session expires after the configured time, the user will be asked for credentials again, it means, they will be redirected to the sign in page.

Options

Timeoutable adds the following options to devise:

* +timeout_in+: the interval to timeout the user session without activity.
Examples
user.timedout?(30.minutes.ago)
Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse Instance Method Summary collapse Class Method Details .required_fields(klass) ⇒ Object
25
26
27
# File 'lib/devise/models/timeoutable.rb', line 25

def self.required_fields(klass)
  []
end
Instance Method Details #timedout?(last_access) ⇒ Boolean

Checks whether the user session has expired based on configured time.

30
31
32
# File 'lib/devise/models/timeoutable.rb', line 30

def timedout?(last_access)
  !timeout_in.nil? && last_access && last_access <= timeout_in.ago
end
#timeout_in ⇒ Object
34
35
36
# File 'lib/devise/models/timeoutable.rb', line 34

def timeout_in
  self.class.timeout_in
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4