fix(backups): allow volume backup delete without password when 2FA off

Skip empty-password rejection so delete works when two-step confirmation is disabled; cover with a feature test.
This commit is contained in:
Andras Bacsai 2026-07-16 14:43:02 +02:00
parent ac36a59088
commit fab012b5c8
2 changed files with 18 additions and 1 deletions

View file

@ -206,7 +206,7 @@ public function delete(?string $password = null, array $selectedActions = [])
{
$this->authorize('update', $this->resource);
if (! $password || ! verifyPasswordConfirmation($password, $this)) {
if (! verifyPasswordConfirmation($password, $this)) {
return 'The provided password is incorrect.';
}

View file

@ -1151,6 +1151,23 @@ function signInForVolumeBackups($testCase, Team $team): User
&& str_contains($process->command, 'archive.tar.gz'));
});
it('deletes a volume backup schedule without a password when two-step confirmation is disabled', function () {
$team = Team::factory()->create();
signInForVolumeBackups($this, $team);
[$application, $volume] = createVolumeBackupApplication($team);
InstanceSettings::get()->update(['disable_two_step_confirmation' => true]);
$backup = $volume->scheduledBackups()->create([
'team_id' => $team->id,
'frequency' => 'daily',
]);
Livewire::test(VolumeBackups::class, ['storage' => $volume, 'resource' => $application])
->call('delete', '')
->assertDispatched('success');
expect($backup->fresh())->toBeNull();
});
it('deletes S3 archives from the storage recorded on each execution', function () {
$team = Team::factory()->create();
signInForVolumeBackups($this, $team);