Class: SignIn::OAuthSession
Instance Method Summary
collapse
descendants_using_encryption, lockbox_options, #timestamp_attributes_for_update_in_model, #valid?
Instance Method Details
#active? ⇒ Boolean
18
19
20
|
# File 'app/models/sign_in/o_auth_session.rb', line 18
def active?
refresh_valid? && session_max_valid?
end
|
#confirm_client_id ⇒ Object
36
37
38
|
# File 'app/models/sign_in/o_auth_session.rb', line 36
def confirm_client_id
errors.add(:base, 'Client id must map to a configuration') unless ClientConfig.valid_client_id?(client_id:)
end
|
#refresh_valid? ⇒ Boolean
28
29
30
|
# File 'app/models/sign_in/o_auth_session.rb', line 28
def refresh_valid?
Time.zone.now < refresh_expiration
end
|
#session_max_valid? ⇒ Boolean
#user_attributes_hash ⇒ Object
22
23
24
|
# File 'app/models/sign_in/o_auth_session.rb', line 22
def user_attributes_hash
@user_attributes_hash ||= user_attributes.present? ? JSON.parse(user_attributes) : {}
end
|