Require password confirmation for app password
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
86aa6197b8
commit
68fa1e5dd8
|
@ -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() {
|
||||
|
|
|
@ -299,6 +299,11 @@
|
|||
},
|
||||
|
||||
_addAppPassword: function () {
|
||||
if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
|
||||
OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._addAppPassword, this));
|
||||
return;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
this._toggleAddingToken(true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue