mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 08:15:24 +00:00
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:
1 parent
ac36a59088
commit
fab012b5c8
2 files changed
+18
-1
No files matched your search
@@ -206,7 +206,7 @@ class VolumeBackups extends Component
|
||||
{
|
||||
$this->authorize('update', $this->resource);
|
||||
|
||||
if (! $password || ! verifyPasswordConfirmation($password, $this)) {
|
||||
if (! verifyPasswordConfirmation($password, $this)) {
|
||||
return 'The provided password is incorrect.';
|
||||
}
|
||||
|
||||
|
||||
@@ -1151,6 +1151,23 @@ it('deletes local archives before deleting a volume backup schedule', function (
|
||||
&& 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);
|
||||
|
||||
Reference in new issue
Block a user