aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-12-16 18:07:39 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-01-29 13:53:45 +0100
commitd49b70773b9e23804ad2e8f25e4ebca43d9e0431 (patch)
tree28ac372693a2995089df9fa2e9c3d36bc84f1959 /apps
parent3749c2c79bc830107f7eb903e990b3fa69e28dac (diff)
downloadnextcloud-server-d49b70773b9e23804ad2e8f25e4ebca43d9e0431.tar.gz
nextcloud-server-d49b70773b9e23804ad2e8f25e4ebca43d9e0431.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')
-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 })