Skip to content

Commit 025f789

Browse files
authored
Merge pull request #58881 from nextcloud/backport/58869/stable32
[stable32] fix(SecurityMiddleware): return header to distinguish error type
2 parents 7f53bfa + 77dc788 commit 025f789

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OC\AppFramework\Middleware\Security\Exceptions\CrossSiteRequestForgeryException;
1414
use OC\AppFramework\Middleware\Security\Exceptions\ExAppRequiredException;
1515
use OC\AppFramework\Middleware\Security\Exceptions\NotAdminException;
16+
use OC\AppFramework\Middleware\Security\Exceptions\NotConfirmedException;
1617
use OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException;
1718
use OC\AppFramework\Middleware\Security\Exceptions\SecurityException;
1819
use OC\AppFramework\Middleware\Security\Exceptions\StrictCookieMissingException;
@@ -321,6 +322,9 @@ public function afterException($controller, $methodName, \Exception $exception):
321322
}
322323
}
323324

325+
if ($exception instanceof NotConfirmedException) {
326+
$response->addHeader('X-NC-Auth-NotConfirmed', 'true');
327+
}
324328
$this->logger->debug($exception->getMessage(), [
325329
'exception' => $exception,
326330
]);

0 commit comments

Comments
 (0)