From 50bf8d16051cdae5a3294eb0edaaceceb9f09446 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Tue, 10 Sep 2024 12:45:18 +0200 Subject: [PATCH] Fix empty username migrations and fix empty hashes breaking supabase # Conflicts: # src/Migration/Destinations/Appwrite.php # src/Migration/Sources/Supabase.php --- bin/MigrationCLI.php | 2 +- src/Migration/Sources/Supabase.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/MigrationCLI.php b/bin/MigrationCLI.php index 097a34c..a9e9b8a 100644 --- a/bin/MigrationCLI.php +++ b/bin/MigrationCLI.php @@ -220,7 +220,7 @@ public function getSource(): Source $_ENV['SOURCE_SUPABASE_TEST_ENDPOINT'], $_ENV['SOURCE_SUPABASE_TEST_KEY'], $_ENV['SOURCE_SUPABASE_TEST_HOST'], - $_ENV['SOURCE_SUPABASE_TEST_DATBASE_NAME'], + $_ENV['SOURCE_SUPABASE_TEST_DATABASE_NAME'], $_ENV['SOURCE_SUPABASE_TEST_DATABASE_USER'], $_ENV['SOURCE_SUPABASE_TEST_DATABASE_PASSWORD'] ); diff --git a/src/Migration/Sources/Supabase.php b/src/Migration/Sources/Supabase.php index e06af13..fa57d8a 100644 --- a/src/Migration/Sources/Supabase.php +++ b/src/Migration/Sources/Supabase.php @@ -384,7 +384,7 @@ private function exportUsers(int $batchSize): void foreach ($users as $user) { $hash = null; - if (array_key_exists('encrypted_password', $user)) { + if (array_key_exists('encrypted_password', $user) && ! empty($user['encrypted_password'])) { $hash = new Hash($user['encrypted_password'], '', Hash::ALGORITHM_BCRYPT); }