mirror of
https://github.com/nextcloud/server.git
synced 2026-06-07 07:43:18 -04:00
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>
This commit is contained in:
parent
27c5c17f1e
commit
193bb176d5
2 changed files with 2 additions and 1 deletions
|
|
@ -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…
Reference in a new issue