Require password confirmation for app password

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2016-09-19 17:13:30 +02:00 committed by Lukas Reschke
parent 86aa6197b8
commit 68fa1e5dd8
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 10 additions and 3 deletions

View File

@ -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() {

View File

@ -299,6 +299,11 @@
},
_addAppPassword: function () {
if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._addAppPassword, this));
return;
}
var _this = this;
this._toggleAddingToken(true);