Class: SignIn::SessionContainer
- Inherits:
-
Object
- Object
- SignIn::SessionContainer
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/sign_in/session_container.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
-
#anti_csrf_token ⇒ Object
readonly
Returns the value of attribute anti_csrf_token.
-
#client_config ⇒ Object
readonly
Returns the value of attribute client_config.
-
#device_secret ⇒ Object
readonly
Returns the value of attribute device_secret.
-
#refresh_token ⇒ Object
readonly
Returns the value of attribute refresh_token.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
Instance Method Summary collapse
- #context ⇒ Object
-
#initialize(session:, refresh_token:, access_token:, anti_csrf_token:, client_config:, device_secret: nil) ⇒ SessionContainer
constructor
rubocop:disable Metrics/ParameterLists.
- #persisted? ⇒ Boolean
Constructor Details
#initialize(session:, refresh_token:, access_token:, anti_csrf_token:, client_config:, device_secret: nil) ⇒ SessionContainer
rubocop:disable Metrics/ParameterLists
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/sign_in/session_container.rb', line 25 def initialize(session:, # rubocop:disable Metrics/ParameterLists refresh_token:, access_token:, anti_csrf_token:, client_config:, device_secret: nil) @session = session @refresh_token = refresh_token @access_token = access_token @anti_csrf_token = anti_csrf_token @client_config = client_config @device_secret = device_secret validate! end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Returns the value of attribute access_token.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def access_token @access_token end |
#anti_csrf_token ⇒ Object (readonly)
Returns the value of attribute anti_csrf_token.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def anti_csrf_token @anti_csrf_token end |
#client_config ⇒ Object (readonly)
Returns the value of attribute client_config.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def client_config @client_config end |
#device_secret ⇒ Object (readonly)
Returns the value of attribute device_secret.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def device_secret @device_secret end |
#refresh_token ⇒ Object (readonly)
Returns the value of attribute refresh_token.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def refresh_token @refresh_token end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
7 8 9 |
# File 'app/models/sign_in/session_container.rb', line 7 def session @session end |
Instance Method Details
#context ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'app/models/sign_in/session_container.rb', line 45 def context { user_uuid: access_token.to_s[:user_uuid], session_handle: session.handle, client_id: session.client_id, type: session.user_verification.credential_type, icn: session.user_account.icn } end |
#persisted? ⇒ Boolean
41 42 43 |
# File 'app/models/sign_in/session_container.rb', line 41 def persisted? false end |