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>
pull/42331/head
Ferdinand Thiessen 6 months ago
parent 3749c2c79b
commit d49b70773b
No known key found for this signature in database
GPG Key ID: 45FAE7268762B400

@ -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;

@ -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 })

Loading…
Cancel
Save