summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlexander Piskun <bigcat88@icloud.com>2023-12-25 18:12:54 +0300
committerAndrey Borysenko <andrey18106x@gmail.com>2023-12-29 14:46:58 +0200
commit12257ac76503be7616b694693bde4f01c2a4abf3 (patch)
tree6a9313a011af4d34f9d6e05984aaf1cac325e7da /core
parent7474b574cae8ecee2753391beb6df07d33c9de27 (diff)
downloadnextcloud-server-12257ac76503be7616b694693bde4f01c2a4abf3.tar.gz
nextcloud-server-12257ac76503be7616b694693bde4f01c2a4abf3.zip
AppAPI: allowed to bypass Two-Factor
Signed-off-by: Alexander Piskun <bigcat88@icloud.com> fix php-cs Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/Middleware/TwoFactorMiddleware.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/Middleware/TwoFactorMiddleware.php b/core/Middleware/TwoFactorMiddleware.php
index 0ea21ce78de..ca0df9d6ab9 100644
--- a/core/Middleware/TwoFactorMiddleware.php
+++ b/core/Middleware/TwoFactorMiddleware.php
@@ -124,7 +124,9 @@ 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