|
|
|
|
@ -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); |
|
|
|
|
|