Skip to content

Commit

Permalink
Merge pull request #43195 from nextcloud/backport/42331/stable28
Browse files Browse the repository at this point in the history
[stable28] fix(settings): Disable renaming for tokens marked to be wiped
  • Loading branch information
susnux authored Feb 1, 2024
2 parents 619dd93 + a61c11f commit d501f2d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private function getAppTokens(): array {
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;
Expand Down
1 change: 1 addition & 0 deletions apps/settings/src/store/authtoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
4 changes: 2 additions & 2 deletions dist/core-common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-common.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-personal-security.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-personal-security.js.map

Large diffs are not rendered by default.

0 comments on commit d501f2d

Please sign in to comment.