Class: SignIn::LogoutRedirectGenerator
- Inherits:
-
Object
- Object
- SignIn::LogoutRedirectGenerator
- Defined in:
- app/services/sign_in/logout_redirect_generator.rb
Instance Attribute Summary collapse
-
#client_config ⇒ Object
readonly
Returns the value of attribute client_config.
-
#credential_type ⇒ Object
readonly
Returns the value of attribute credential_type.
Instance Method Summary collapse
- #authenticated_with_logingov? ⇒ Boolean private
-
#initialize(client_config:, credential_type: nil) ⇒ LogoutRedirectGenerator
constructor
A new instance of LogoutRedirectGenerator.
- #logingov_service ⇒ Object private
- #logout_redirect_uri ⇒ Object private
- #parse_logout_redirect_uri ⇒ Object private
- #perform ⇒ Object
Constructor Details
#initialize(client_config:, credential_type: nil) ⇒ LogoutRedirectGenerator
Returns a new instance of LogoutRedirectGenerator.
9 10 11 12 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 9 def initialize(client_config:, credential_type: nil) @credential_type = credential_type @client_config = client_config end |
Instance Attribute Details
#client_config ⇒ Object (readonly)
Returns the value of attribute client_config.
7 8 9 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 7 def client_config @client_config end |
#credential_type ⇒ Object (readonly)
Returns the value of attribute credential_type.
7 8 9 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 7 def credential_type @credential_type end |
Instance Method Details
#authenticated_with_logingov? ⇒ Boolean (private)
30 31 32 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 30 def authenticated_with_logingov? credential_type == Constants::Auth::LOGINGOV end |
#logingov_service ⇒ Object (private)
38 39 40 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 38 def logingov_service AuthenticationServiceRetriever.new(type: Constants::Auth::LOGINGOV).perform end |
#logout_redirect_uri ⇒ Object (private)
34 35 36 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 34 def logout_redirect_uri @logout_redirect_uri ||= client_config&.logout_redirect_uri end |
#parse_logout_redirect_uri ⇒ Object (private)
26 27 28 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 26 def parse_logout_redirect_uri URI.parse(logout_redirect_uri).to_s end |
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/services/sign_in/logout_redirect_generator.rb', line 14 def perform return unless logout_redirect_uri if authenticated_with_logingov? logingov_service.render_logout(logout_redirect_uri) else parse_logout_redirect_uri end end |