summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-09-19 17:13:30 +0200
committerLukas Reschke <lukas@statuscode.ch>2016-11-18 12:10:50 +0100
commit68fa1e5dd8a588d3903dfee4dab5c740637e0cf6 (patch)
treec7c56a938432f0952d92a369685c947aa00ff37b /settings
parent86aa6197b881540b39d8a3c4475ee6b453b71aab (diff)
downloadnextcloud-server-68fa1e5dd8a588d3903dfee4dab5c740637e0cf6.tar.gz
nextcloud-server-68fa1e5dd8a588d3903dfee4dab5c740637e0cf6.zip
Require password confirmation for app password
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/AuthSettingsController.php8
-rw-r--r--settings/js/authtoken_view.js5
2 files changed, 10 insertions, 3 deletions
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php
index 4e3d05a14e8..732f3abd1fd 100644
--- a/settings/Controller/AuthSettingsController.php
+++ b/settings/Controller/AuthSettingsController.php
@@ -111,7 +111,9 @@ class AuthSettingsController extends Controller {
/**
* @NoAdminRequired
* @NoSubadminRequired
+ * @PasswordConfirmationRequired
*
+ * @param string $name
* @return JSONResponse
*/
public function create($name) {
@@ -138,11 +140,11 @@ class AuthSettingsController extends Controller {
$tokenData = $deviceToken->jsonSerialize();
$tokenData['canDelete'] = true;
- return [
+ return new JSONResponse([
'token' => $token,
'loginName' => $loginName,
- 'deviceToken' => $tokenData
- ];
+ 'deviceToken' => $tokenData,
+ ]);
}
private function getServiceNotAvailableResponse() {
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js
index 0939913cc1a..c45e4b7ec44 100644
--- a/settings/js/authtoken_view.js
+++ b/settings/js/authtoken_view.js
@@ -299,6 +299,11 @@
},
_addAppPassword: function () {
+ if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
+ OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._addAppPassword, this));
+ return;
+ }
+
var _this = this;
this._toggleAddingToken(true);