class Arkaan::Authentication::Session

A session represents the connection of the user on our frontend application. Nobody else than our frontend should have access to the session or it's content (in particular to the token), instead they shall use OAuth2.0. A session shall ONLY be created by a premium application (only our frontend applications are premium). @author Vincent Courtois <courtois.vincent@outlook.com>

Public Instance Methods

expired?() click to toggle source

Checks if the session is expired (it has a duration, and the duration has passed) @return [Boolean] TRUE if the session is expired, FALSE otherwise.

# File lib/arkaan/authentication/session.rb, line 42
def expired?
  duration != 0 && created_at + duration.to_f < DateTime.now
end