1212use OxidEsales \Eshop \Core \Utils ;
1313use OxidEsales \EshopCommunity \Internal \Framework \Session \SessionInterface ;
1414use OxidEsales \SecurityModule \Authentication \Service \InternalRedirectServiceInterface ;
15- use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Infrastructure \Repository \UserRepositoryInterface ;
1615use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Infrastructure \Service \UserLoginAdapterInterface ;
17- use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Settings \TwoFASettingsInterface ;
16+ use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Settings \TwoFAShopSettingsInterface ;
17+ use OxidEsales \SecurityModule \Authentication \TwoFactorAuth \Settings \TwoFAUserSettingsInterface ;
1818
1919/**
2020 * todo-high: challenge the idea - session part should go to the separate login state service
@@ -25,12 +25,12 @@ class TwoFAUserService implements TwoFAUserServiceInterface
2525
2626 public function __construct (
2727 private TwoFAServiceInterface $ twoFAService ,
28- private TwoFASettingsInterface $ settings ,
28+ private TwoFAShopSettingsInterface $ settings ,
2929 private Utils $ utils ,
3030 private SessionInterface $ session ,
3131 private UserLoginAdapterInterface $ loginAdapter ,
3232 private InternalRedirectServiceInterface $ redirectService ,
33- private UserRepositoryInterface $ userRepository ,
33+ private TwoFAUserSettingsInterface $ userSettings ,
3434 ) {
3535 }
3636
@@ -67,7 +67,6 @@ public function isTwoFARequired(string $userId): bool
6767 return false ;
6868 }
6969
70- $ user = $ this ->userRepository ->getUserById ($ userId );
71- return $ user ->isTwoFAEnabled ();
70+ return $ this ->userSettings ->isEnabledForUser ($ userId );
7271 }
7372}
0 commit comments