aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlexander Piskun <bigcat88@icloud.com>2023-12-25 18:12:54 +0300
committerAlexander Piskun <bigcat88@icloud.com>2023-12-28 20:59:02 +0300
commit26d343d33aa763b7126937680769525e51638b90 (patch)
tree0a5496fb3938a4873de535322cfebad948d95398 /core
parent17cb5dadcd6be4bf26c5d7bb012db01722ce1ec0 (diff)
downloadnextcloud-server-26d343d33aa763b7126937680769525e51638b90.tar.gz
nextcloud-server-26d343d33aa763b7126937680769525e51638b90.zip
AppAPI: allowed to bypass Two-Factor
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
Diffstat (limited to 'core')
-rw-r--r--core/Middleware/TwoFactorMiddleware.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php
index f421528dff7..4b5618eb23d 100644
--- a/core/Middleware/TwoFactorMiddleware.php
+++ b/core/Middleware/TwoFactorMiddleware.php
@@ -100,7 +100,10 @@ class TwoFactorMiddleware extends Middleware {
if ($this->userSession->isLoggedIn()) {
$user = $this->userSession->getUser();
- if ($this->session->exists('app_password') || $this->twoFactorManager->isTwoFactorAuthenticated($user)) {
+ if ($this->session->exists('app_password') // authenticated using an app password
+ || $this->session->exists('app_api') // authenticated using an AppAPI Auth
+ || $this->twoFactorManager->isTwoFactorAuthenticated($user)) {
+
$this->checkTwoFactor($controller, $methodName, $user);
} elseif ($controller instanceof TwoFactorChallengeController) {
// Allow access to the two-factor controllers only if two-factor authentication