fix(settings): Fix missing import for strict mode of app password deletion and edit

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2026-05-13 14:51:20 +02:00
parent b2f8cb2e58
commit fdd2fa3a1b
No known key found for this signature in database
GPG key ID: F72FA5B49FFA96B0
2 changed files with 4 additions and 5 deletions

View file

@ -74,7 +74,7 @@ class AuthSettingsController extends Controller {
* @return JSONResponse
*/
#[NoAdminRequired]
#[PasswordConfirmationRequired]
#[PasswordConfirmationRequired(strict: true)]
public function create($name) {
if ($this->checkAppToken()) {
return $this->getServiceNotAvailableResponse();

View file

@ -5,7 +5,7 @@
import { showError } from '@nextcloud/dialogs'
import { loadState } from '@nextcloud/initial-state'
import { translate as t } from '@nextcloud/l10n'
import { confirmPassword } from '@nextcloud/password-confirmation'
import { addPasswordConfirmationInterceptors, confirmPassword, PwdConfirmationMode } from '@nextcloud/password-confirmation'
import { generateUrl } from '@nextcloud/router'
import { defineStore } from 'pinia'
@ -13,6 +13,7 @@ import axios from '@nextcloud/axios'
import logger from '../logger'
const BASE_URL = generateUrl('/settings/personal/authtokens')
addPasswordConfirmationInterceptors(axios)
const confirm = () => {
return new Promise(resolve => {
@ -84,9 +85,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
logger.debug('Creating a new app token')
try {
await confirmPassword()
const { data } = await axios.post<ITokenResponse>(BASE_URL, { name })
const { data } = await axios.post<ITokenResponse>(BASE_URL, { name }, { confirmPassword: PwdConfirmationMode.Strict })
this.tokens.push(data.deviceToken)
logger.debug('App token created')
return data