mirror of
https://github.com/nextcloud/server.git
synced 2026-06-13 18:50:47 -04:00
Merge pull request #59608 from nextcloud/backport/59602/stable33
[stable33] fix(apppasswords): Require password also on delete and update
This commit is contained in:
commit
281d95db2b
4 changed files with 7 additions and 5 deletions
|
|
@ -174,6 +174,7 @@ class AuthSettingsController extends Controller {
|
|||
* @return array|JSONResponse
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function destroy($id) {
|
||||
if ($this->checkAppToken()) {
|
||||
return new JSONResponse([], Http::STATUS_BAD_REQUEST);
|
||||
|
|
@ -202,6 +203,7 @@ class AuthSettingsController extends Controller {
|
|||
* @return array|JSONResponse
|
||||
*/
|
||||
#[NoAdminRequired]
|
||||
#[PasswordConfirmationRequired(strict: true)]
|
||||
public function update($id, array $scope, string $name) {
|
||||
if ($this->checkAppToken()) {
|
||||
return new JSONResponse([], Http::STATUS_BAD_REQUEST);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
|
|||
* @param token Token to update
|
||||
*/
|
||||
async updateToken(token: IToken) {
|
||||
const { data } = await axios.put(`${BASE_URL}/${token.id}`, token)
|
||||
const { data } = await axios.put(`${BASE_URL}/${token.id}`, token, { confirmPassword: PwdConfirmationMode.Strict })
|
||||
return data
|
||||
},
|
||||
|
||||
|
|
@ -111,7 +111,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
|
|||
this.tokens = this.tokens.filter(({ id }) => id !== token.id)
|
||||
|
||||
try {
|
||||
await axios.delete(`${BASE_URL}/${token.id}`)
|
||||
await axios.delete(`${BASE_URL}/${token.id}`, { confirmPassword: PwdConfirmationMode.Strict })
|
||||
logger.debug('App token deleted')
|
||||
return true
|
||||
} catch (error) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue