Browse Source

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>
tags/v29.0.0beta1
Ferdinand Thiessen 6 months ago
parent
commit
d49b70773b
No account linked to committer's email address

+ 1
- 1
apps/settings/lib/Settings/Personal/Security/Authtokens.php View File

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

+ 1
- 0
apps/settings/src/store/authtoken.ts View File

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