Soften 2FAs migrations detection by ignoring schema version - Fixes #253

This commit is contained in:
Bubka 2023-12-11 14:10:51 +01:00
parent 9d5d2705e4
commit 15c31c3341

View File

@ -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 {