Skip to content

Commit d501f2d

Browse files
authored
Merge pull request #43195 from nextcloud/backport/42331/stable28
[stable28] fix(settings): Disable renaming for tokens marked to be wiped
2 parents 619dd93 + a61c11f commit d501f2d

File tree

6 files changed

+8
-7
lines changed

6 files changed

+8
-7
lines changed

apps/settings/lib/Settings/Personal/Security/Authtokens.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private function getAppTokens(): array {
105105
return array_map(function (IToken $token) use ($sessionToken) {
106106
$data = $token->jsonSerialize();
107107
$data['canDelete'] = true;
108-
$data['canRename'] = $token instanceof INamedToken;
108+
$data['canRename'] = $token instanceof INamedToken && $data['type'] !== IToken::WIPE_TOKEN;
109109
if ($sessionToken->getId() === $token->getId()) {
110110
$data['canDelete'] = false;
111111
$data['canRename'] = false;

apps/settings/src/store/authtoken.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export const useAuthTokenStore = defineStore('auth-token', {
153153
logger.debug('App token marked for wipe', { token })
154154

155155
token.type = TokenType.WIPING_TOKEN
156+
token.canRename = false // wipe tokens can not be renamed
156157
return true
157158
} catch (error) {
158159
logger.error('Could not wipe app token', { error })

dist/core-common.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/core-common.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-personal-security.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-personal-security.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)