mirror of
https://github.com/nextcloud/server.git
synced 2026-05-16 10:30:10 -04:00
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:
parent
b2f8cb2e58
commit
fdd2fa3a1b
2 changed files with 4 additions and 5 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue