diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-19 16:58:38 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-11-18 11:57:16 +0100 |
commit | 86aa6197b881540b39d8a3c4475ee6b453b71aab (patch) | |
tree | 6f1748a49ebfa248abea6a79c8918eecb474a15e /apps/twofactor_backupcodes/lib | |
parent | a0d6c6593a4c6f08c2c4dd516c85ad59eb639be2 (diff) | |
download | nextcloud-server-86aa6197b881540b39d8a3c4475ee6b453b71aab.tar.gz nextcloud-server-86aa6197b881540b39d8a3c4475ee6b453b71aab.zip |
Require confirmation when generating backup codes
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/twofactor_backupcodes/lib')
-rw-r--r-- | apps/twofactor_backupcodes/lib/Controller/SettingsController.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php index fed7634643d..9b0b0fc57ba 100644 --- a/apps/twofactor_backupcodes/lib/Controller/SettingsController.php +++ b/apps/twofactor_backupcodes/lib/Controller/SettingsController.php @@ -59,15 +59,17 @@ class SettingsController extends Controller { /** * @NoAdminRequired + * @PasswordConfirmationRequired + * * @return JSONResponse */ public function createCodes() { $user = $this->userSession->getUser(); $codes = $this->storage->createCodes($user); - return [ - 'codes' => $codes, - 'state' => $this->storage->getBackupCodesState($user), - ]; + return new JSONResponse([ + 'codes' => $codes, + 'state' => $this->storage->getBackupCodesState($user), + ]); } } |