Signed-off-by: Joas Schilling <coding@schilljs.com>
}.bind(this));
},
_onGenerateBackupCodes: function () {
+ if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
+ OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._onGenerateBackupCodes, this));
+ return;
+ }
+
// Hide old codes
this._enabled = false;
this.render();
/**
* @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),
+ ]);
}
}