From 15c31c33414edda11c0c1b00cb982ede22546498 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Mon, 11 Dec 2023 14:10:51 +0100 Subject: [PATCH] Soften 2FAs migrations detection by ignoring schema version - Fixes #253 --- app/Factories/MigratorFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Factories/MigratorFactory.php b/app/Factories/MigratorFactory.php index 0aa1d391..1b71df20 100644 --- a/app/Factories/MigratorFactory.php +++ b/app/Factories/MigratorFactory.php @@ -155,7 +155,7 @@ private function isAegisJSON(string $migrationPayload) : mixed */ private function is2FASv2(string $migrationPayload) : mixed { - // - 2FAS JSON : is a JSON object with the key 'schemaVersion' == 2 and a key 'services' full of objects like + // - 2FAS JSON : is a JSON object with a 'schemaVersion' key and a key 'services' full of objects like // { // "secret": "A4GRFTVVRBGY7UIW", // ... @@ -178,7 +178,7 @@ private function is2FASv2(string $migrationPayload) : mixed $json = json_decode($migrationPayload, true); - if (Arr::get($json, 'schemaVersion') == 2 && (Arr::has($json, 'services') || Arr::has($json, 'servicesEncrypted'))) { + if (Arr::has($json, 'schemaVersion') && (Arr::has($json, 'services') || Arr::has($json, 'servicesEncrypted'))) { if (Arr::has($json, 'servicesEncrypted')) { throw new EncryptedMigrationException(); } else {