Merge pull request #42331 from nextcloud/fix/auth-token-settings

fix(settings): Disable renaming for tokens marked to be wiped
pull/43185/head
Ferdinand Thiessen 4 months ago committed by GitHub
commit cff36b7156
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save