diff --git a/lib/Controller/EmailRecoveryController.php b/lib/Controller/EmailRecoveryController.php index 54db94367b9fe2371e3383dc00086f530f143b95..0cb6c15638a2362ac5ab9ac719c8d73dce90b254 100644 --- a/lib/Controller/EmailRecoveryController.php +++ b/lib/Controller/EmailRecoveryController.php @@ -34,6 +34,9 @@ use OCA\EmailRecovery\Exception\SameRecoveryEmailAsEmailException; use OCA\EmailRecovery\Exception\TooManyVerificationAttemptsException; use OCA\EmailRecovery\Service\RecoveryEmailService; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\Attribute\NoAdminRequired; +use OCP\AppFramework\Http\Attribute\PublicPage; +use OCP\AppFramework\Http\Attribute\NoCSRFRequired; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; @@ -71,10 +74,7 @@ class EmailRecoveryController extends Controller { $this->userManager = $userManager; } - /** - * @NoAdminRequired - */ - + #[NoAdminRequired] public function getRecoveryEmail() { $response = new JSONResponse(); $userId = $this->userSession->getUser()->getUID(); @@ -85,11 +85,9 @@ class EmailRecoveryController extends Controller { return $response; } - /** - * @NoAdminRequired - * @PublicPage - * @NoCSRFRequired - */ + #[NoAdminRequired] + #[PublicPage] + #[NoCSRFRequired] public function verifyRecoveryEmail(string $token, string $userId): TemplateResponse { try { //decrypt email @@ -126,10 +124,7 @@ class EmailRecoveryController extends Controller { } - /** - * @NoAdminRequired - */ - + #[NoAdminRequired] public function setRecoveryEmail(string $recoveryEmail) { $userId = $this->userSession->getUser()->getUID(); $response = new JSONResponse(); @@ -137,9 +132,7 @@ class EmailRecoveryController extends Controller { return $response; } - /** - * @NoAdminRequired - */ + #[NoAdminRequired] public function resendRecoveryEmail(string $recoveryEmail) { $response = new JSONResponse(); $response->setStatus(200);