Merge pull request #46820 from nextcloud/refactor/twofactor_backupcodes/security-attributes

This commit is contained in:
Kate 2024-07-28 08:48:56 +02:00 committed by GitHub
commit 69a203d262
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,6 +10,8 @@ namespace OCA\TwoFactorBackupCodes\Controller;
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 @@ class SettingsController extends Controller {
}
/**
* @NoAdminRequired
* @PasswordConfirmationRequired
*
* @return JSONResponse
*/
#[NoAdminRequired]
#[PasswordConfirmationRequired]
public function createCodes(): JSONResponse {
$user = $this->userSession->getUser();
$codes = $this->storage->createCodes($user);