From c5c6517303dfa3faafcc13cfa9b8ffbf9cbbee18 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Thu, 25 Jul 2024 13:14:50 +0200 Subject: [PATCH] refactor(twofactor_backupcodes): Replace security annotations with respective attributes Signed-off-by: provokateurin --- .../lib/Controller/SettingsController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php index 007b18f9cd5d0..7982ce382c4a1 100644 --- a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php +++ b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php @@ -10,6 +10,8 @@ use OCA\TwoFactorBackupCodes\Service\BackupCodeStorage; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\PasswordConfirmationRequired; use OCP\AppFramework\Http\JSONResponse; use OCP\IRequest; use OCP\IUserSession; @@ -35,11 +37,10 @@ public function __construct($appName, IRequest $request, BackupCodeStorage $stor } /** - * @NoAdminRequired - * @PasswordConfirmationRequired - * * @return JSONResponse */ + #[NoAdminRequired] + #[PasswordConfirmationRequired] public function createCodes(): JSONResponse { $user = $this->userSession->getUser(); $codes = $this->storage->createCodes($user);