Skip to content

Commit 09a0f8b

Browse files
authored
Merge pull request #192 from humhub/enh/ignore-2fa
Disable 2FA for Rest
2 parents 3f1cfb9 + 55ce0ed commit 09a0f8b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Module.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use humhub\components\bootstrap\ModuleAutoLoader;
1212
use humhub\components\Module as BaseModule;
1313
use Yii;
14+
use yii\base\Event;
1415
use yii\helpers\Url;
1516

1617
class Module extends BaseModule
@@ -107,4 +108,13 @@ public function isActiveModule($moduleId)
107108

108109
return !isset($apiModules[$moduleId]) || $apiModules[$moduleId];
109110
}
111+
112+
public function beforeAction($action)
113+
{
114+
Yii::$app->on('twofa.beforeCheck', function (Event $event) use ($action) {
115+
$event->handled = $action->controller->id !== 'admin-user';
116+
});
117+
118+
return parent::beforeAction($action);
119+
}
110120
}

docs/CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
Changelog
22
=========
33

4-
0.10.6 (Unreleased)
5-
----------------------
4+
0.10.6 (April 17, 2025)
5+
-----------------------
6+
- Enh #192: Ignore all actions from 2FA check
67
- Fix #194: Fix failing tests
78

89
0.10.5 (March 3, 2025)

0 commit comments

Comments
 (0)