Class: SignIn::StatePayloadVerifier
- Inherits:
-
Object
- Object
- SignIn::StatePayloadVerifier
- Defined in:
- app/services/sign_in/state_payload_verifier.rb
Instance Attribute Summary collapse
-
#state_payload ⇒ Object
readonly
Returns the value of attribute state_payload.
Instance Method Summary collapse
-
#initialize(state_payload:) ⇒ StatePayloadVerifier
constructor
A new instance of StatePayloadVerifier.
- #perform ⇒ Object
- #state_code ⇒ Object private
- #validate_state_code ⇒ Object private
Constructor Details
#initialize(state_payload:) ⇒ StatePayloadVerifier
Returns a new instance of StatePayloadVerifier.
7 8 9 |
# File 'app/services/sign_in/state_payload_verifier.rb', line 7 def initialize(state_payload:) @state_payload = state_payload end |
Instance Attribute Details
#state_payload ⇒ Object (readonly)
Returns the value of attribute state_payload.
5 6 7 |
# File 'app/services/sign_in/state_payload_verifier.rb', line 5 def state_payload @state_payload end |
Instance Method Details
#perform ⇒ Object
11 12 13 |
# File 'app/services/sign_in/state_payload_verifier.rb', line 11 def perform validate_state_code end |
#state_code ⇒ Object (private)
17 18 19 |
# File 'app/services/sign_in/state_payload_verifier.rb', line 17 def state_code @state_code ||= StateCode.find(state_payload.code) end |
#validate_state_code ⇒ Object (private)
21 22 23 24 25 |
# File 'app/services/sign_in/state_payload_verifier.rb', line 21 def validate_state_code raise Errors::StateCodeInvalidError.new message: 'Code in state is not valid' unless state_code ensure state_code&.destroy end |