Merge pull request #15022 from spencerrlongg/livewire-delete-button

Resolved Potential Issue when Deleting Personal Access Tokens
This commit is contained in:
snipe 2024-07-03 22:24:25 +01:00 committed by GitHub
commit f1f68b8ef6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -49,6 +49,6 @@ class PersonalAccessTokens extends Component
{
//this needs safety (though the scope of auth::user might kind of do it...)
//seems like it does, test more
Auth::user()->tokens()->find($tokenId)->delete();
Auth::user()->tokens()->find($tokenId)?->delete();
}
}

View file

@ -48,7 +48,8 @@
</td>
<!-- Delete Button -->
<td style="vertical-align: middle;" class="text-right">
<a class="action-link btn btn-danger btn-sm" wire:click="deleteToken('{{ $token->id }}')">
<a class="action-link btn btn-danger btn-sm" wire:click="deleteToken('{{ $token->id }}')"
wire:loading.attr="disabled">
<i class="fas fa-trash"></i>
</a>
</td>