Module: StandardId::LifecycleHooks
- Extended by:
- ActiveSupport::Concern
- Included in:
- Web::Auth::Callback::ProvidersController, Web::LoginController, Web::LoginVerifyController, Web::SignupController
- Defined in:
- app/controllers/concerns/standard_id/lifecycle_hooks.rb
Overview
Public concern providing authentication lifecycle hook invocations.
Include this in host app controllers that implement custom authentication
flows but want to participate in StandardId's hook system. The hooks are
configured via StandardId.config.before_sign_in, after_sign_in, and
after_account_created callbacks.
This is the same concern used internally by the WebEngine's built-in controllers -- there is no separate "internal" version.
Requires the including controller to include StandardId::WebAuthentication
(for session_manager and request access).
Constant Summary collapse
- DEFAULT_PROFILE_RESOLVER =
Default profile resolver when StandardId.config.profile_resolver is nil.
->(acct, pt) { acct.profiles.exists?(profileable_type: pt) }
- DEFAULT_SCOPE_RESOLVER =
Default scope resolver when StandardId.config.scope_resolver is nil. Preserves the historical behaviour of reading :scope from route defaults.
->(request:, session:) { request.path_parameters[:scope]&.to_sym }