Class: Virtuaservices::Authentication::Session

Inherits:
Object
  • Object
show all
Includes:
Mongoid::Document, Mongoid::Timestamps
Defined in:
lib/virtuaservices/authentication/session.rb

Overview

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 the OAuth2.0 protocol. A session shall ONLY be created by a premium application (only our frontend applications are premium).

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#accountVirtuaservices::Account

Returns the account connected to the application.

Returns:



20
# File 'lib/virtuaservices/authentication/session.rb', line 20

belongs_to :account, class_name: 'Virtuaservices::Account', inverse_of: :sessions

#tokenString

Returns the unique token for this session, used to identify it and be sure the user is connected on this application.

Returns:

  • (String)

    the unique token for this session, used to identify it and be sure the user is connected on this application.



13
# File 'lib/virtuaservices/authentication/session.rb', line 13

field :token, type: String

#websocket_idString

Returns the ID of the websocket on which the session is connected. It’s not an association because instances are embedded.

Returns:

  • (String)

    the ID of the websocket on which the session is connected. It’s not an association because instances are embedded.



16
# File 'lib/virtuaservices/authentication/session.rb', line 16

field :websocket_id, type: String, default: ''