aboutsummaryrefslogtreecommitdiffstats
path: root/apps/settings
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-12-16 18:07:39 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-01-29 17:47:46 +0000
commit193bb176d517ddbc7738fb762731851ddb421326 (patch)
tree0d90242d66f4dd1c70d6ddae8efd51f3e1c0a75d /apps/settings
parent27c5c17f1ed0a70d856398b49058571903061fe3 (diff)
downloadnextcloud-server-193bb176d517ddbc7738fb762731851ddb421326.tar.gz
nextcloud-server-193bb176d517ddbc7738fb762731851ddb421326.zip
fix(settings): Disable renaming for tokens marked to be wiped
This otherwise a WipeException will be thrown when trying to rename Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/settings')
-rw-r--r--apps/settings/lib/Settings/Personal/Security/Authtokens.php2
-rw-r--r--apps/settings/src/store/authtoken.ts1
2 files changed, 2 insertions, 1 deletions
diff --git a/apps/settings/lib/Settings/Personal/Security/Authtokens.php b/apps/settings/lib/Settings/Personal/Security/Authtokens.php
index 9a7405fb7a2..e4901e06a55 100644
--- a/apps/settings/lib/Settings/Personal/Security/Authtokens.php
+++ b/apps/settings/lib/Settings/Personal/Security/Authtokens.php
@@ -105,7 +105,7 @@ class Authtokens implements ISettings {
return array_map(function (IToken $token) use ($sessionToken) {
$data = $token->jsonSerialize();
$data['canDelete'] = true;
- $data['canRename'] = $token instanceof INamedToken;
+ $data['canRename'] = $token instanceof INamedToken && $data['type'] !== IToken::WIPE_TOKEN;
if ($sessionToken->getId() === $token->getId()) {
$data['canDelete'] = false;
$data['canRename'] = false;
diff --git a/apps/settings/src/store/authtoken.ts b/apps/settings/src/store/authtoken.ts
index 399c39faae7..535d9cb32e3 100644
--- a/apps/settings/src/store/authtoken.ts
+++ b/apps/settings/src/store/authtoken.ts
@@ -153,6 +153,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
logger.debug('App token marked for wipe', { token })
token.type = TokenType.WIPING_TOKEN
+ token.canRename = false // wipe tokens can not be renamed
return true
} catch (error) {
logger.error('Could not wipe app token', { error })