File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 4545use OC \Authentication \Exceptions \PasswordLoginForbiddenException ;
4646use OC \Authentication \Token \IProvider ;
4747use OC \Authentication \Token \IToken ;
48+ use OC \Authentication \TwoFactorAuth \Manager as TwoFactorAuthManager ;
4849use OC \Hooks \Emitter ;
4950use OC \Hooks \PublicEmitter ;
5051use OC_User ;
@@ -514,7 +515,7 @@ protected function isTwoFactorEnforced($username) {
514515 $ user = $ users [0 ];
515516 }
516517 // DI not possible due to cyclic dependencies :'-/
517- return OC ::$ server ->getTwoFactorAuthManager ( )->isTwoFactorAuthenticated ($ user );
518+ return OC ::$ server ->get (TwoFactorAuthManager::class )->isTwoFactorAuthenticated ($ user );
518519 }
519520
520521 /**
Original file line number Diff line number Diff line change 2727 * along with this program. If not, see <http://www.gnu.org/licenses/>
2828 *
2929 */
30+
31+ use OC \Authentication \TwoFactorAuth \Manager as TwoFactorAuthManager ;
32+
3033class OC_JSON {
3134 /**
3235 * Check if the app is enabled, send json error msg if not
@@ -48,7 +51,7 @@ public static function checkAppEnabled($app) {
4851 * @suppress PhanDeprecatedFunction
4952 */
5053 public static function checkLoggedIn () {
51- $ twoFactorAuthManger = \OC ::$ server ->getTwoFactorAuthManager ( );
54+ $ twoFactorAuthManger = \OC ::$ server ->get (TwoFactorAuthManager::class );
5255 if (!\OC ::$ server ->getUserSession ()->isLoggedIn ()
5356 || $ twoFactorAuthManger ->needsSecondFactor (\OC ::$ server ->getUserSession ()->getUser ())) {
5457 $ l = \OC ::$ server ->getL10N ('lib ' );
Original file line number Diff line number Diff line change 6565 */
6666
6767use bantu \IniGetWrapper \IniGetWrapper ;
68+ use OC \Authentication \TwoFactorAuth \Manager as TwoFactorAuthManager ;
6869use OC \Files \SetupManager ;
6970use OCP \Files \Template \ITemplateManager ;
7071use OCP \IConfig ;
@@ -792,7 +793,7 @@ public static function checkLoggedIn() {
792793 exit ();
793794 }
794795 // Redirect to 2FA challenge selection if 2FA challenge was not solved yet
795- if (\OC ::$ server ->getTwoFactorAuthManager ( )->needsSecondFactor (\OC ::$ server ->getUserSession ()->getUser ())) {
796+ if (\OC ::$ server ->get (TwoFactorAuthManager::class )->needsSecondFactor (\OC ::$ server ->getUserSession ()->getUser ())) {
796797 header ('Location: ' . \OC ::$ server ->getURLGenerator ()->linkToRoute ('core.TwoFactorChallenge.selectChallenge ' ));
797798 exit ();
798799 }
You can’t perform that action at this time.
0 commit comments