Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <[email protected]>
  • Loading branch information
susnux committed Jan 29, 2024
commit d49b70773b9e23804ad2e8f25e4ebca43d9e0431
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;

Check notice

Code scanning / Psalm

DeprecatedClass

Class OC\Authentication\Token\IToken is deprecated
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