-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow "TwoFactor Nextcloud Notifications" to pull the state of the 2FA again #29056
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
use OC\Core\Controller\LoginController; | ||
use OC\Core\Controller\TwoFactorChallengeController; | ||
use OC\User\Session; | ||
use OCA\TwoFactorNextcloudNotification\Controller\APIController; | ||
use OCP\AppFramework\Controller; | ||
use OCP\AppFramework\Http\RedirectResponse; | ||
use OCP\AppFramework\Middleware; | ||
|
@@ -82,6 +83,11 @@ public function __construct(Manager $twoFactorManager, Session $userSession, ISe | |
* @param string $methodName | ||
*/ | ||
public function beforeController($controller, $methodName) { | ||
if ($controller instanceof APIController && $methodName === 'poll') { | ||
// Allow polling the twofactor nextcloud notifications state | ||
return; | ||
} | ||
Comment on lines
+86
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this work if the app is not locally installed? - If yes: LGTM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. afaik doing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it works, same as ::class (which is what this uses internally I guess) |
||
|
||
if ($controller instanceof TwoFactorChallengeController | ||
&& $this->userSession->getUser() !== null | ||
&& !$this->reflector->hasAnnotation('TwoFactorSetUpDoneRequired')) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we could have fixed this bug without introducing app-specifics into the server code base? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could introduce another annotation which is like
@PublicPageButWith(out)ExtraSteps