Skip to content

Commit 5d0826f

Browse files
committed
Allow Repository to use the relevant validation contract without passing it in directly
1 parent 049bc4c commit 5d0826f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

app/db/repository/authenticator_repository.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ module Repository
33
class AuthenticatorRepository
44
def initialize(
55
data_object:,
6-
contract:,
76
resource_repository: ::Resource,
87
logger: Rails.logger,
98
pkce_support_enabled: Rails.configuration.feature_flags.enabled?(:pkce_support)
109
)
1110
@resource_repository = resource_repository
1211
@data_object = data_object
13-
@contract = contract
12+
@contract = "#{data_object}Contract".constantize.new
1413
@logger = logger
1514
@pkce_support_enabled = pkce_support_enabled
1615
end

app/domain/authentication/handler/authentication_handler.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ def initialize(
3232
@identity_resolver = "#{namespace}::ResolveIdentity".constantize
3333
@strategy = "#{namespace}::Strategy".constantize
3434
@authn_repo = authn_repo.new(
35-
data_object: "#{namespace}::DataObjects::Authenticator".constantize,
36-
contract: "#{namespace}::DataObjects::AuthenticatorContract".constantize.new
35+
data_object: "#{namespace}::DataObjects::Authenticator".constantize
3736
)
3837
end
3938

0 commit comments

Comments
 (0)