mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Explicitly allow some routes without 2FA
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
7be83b23f4
commit
ea38a798f3
2 changed files with 7 additions and 0 deletions
|
|
@ -98,6 +98,7 @@ class OCJSController extends Controller {
|
|||
|
||||
/**
|
||||
* @NoCSRFRequired
|
||||
* @NoTwoFactorRequired
|
||||
* @PublicPage
|
||||
*
|
||||
* @return DataDisplayResponse
|
||||
|
|
|
|||
|
|
@ -83,6 +83,12 @@ class TwoFactorMiddleware extends Middleware {
|
|||
* @param string $methodName
|
||||
*/
|
||||
public function beforeController($controller, $methodName) {
|
||||
if ($this->reflector->hasAnnotation('NoTwoFactorRequired')) {
|
||||
// Route handler explicitly marked to work without finished 2FA are
|
||||
// not blocked
|
||||
return;
|
||||
}
|
||||
|
||||
if ($controller instanceof APIController && $methodName === 'poll') {
|
||||
// Allow polling the twofactor nextcloud notifications state
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue