Skip to content

Commit 15c31c3

Browse files
committed
Soften 2FAs migrations detection by ignoring schema version - Fixes #253
1 parent 9d5d270 commit 15c31c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Factories/MigratorFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private function isAegisJSON(string $migrationPayload) : mixed
155155
*/
156156
private function is2FASv2(string $migrationPayload) : mixed
157157
{
158-
// - 2FAS JSON : is a JSON object with the key 'schemaVersion' == 2 and a key 'services' full of objects like
158+
// - 2FAS JSON : is a JSON object with a 'schemaVersion' key and a key 'services' full of objects like
159159
// {
160160
// "secret": "A4GRFTVVRBGY7UIW",
161161
// ...
@@ -178,7 +178,7 @@ private function is2FASv2(string $migrationPayload) : mixed
178178

179179
$json = json_decode($migrationPayload, true);
180180

181-
if (Arr::get($json, 'schemaVersion') == 2 && (Arr::has($json, 'services') || Arr::has($json, 'servicesEncrypted'))) {
181+
if (Arr::has($json, 'schemaVersion') && (Arr::has($json, 'services') || Arr::has($json, 'servicesEncrypted'))) {
182182
if (Arr::has($json, 'servicesEncrypted')) {
183183
throw new EncryptedMigrationException();
184184
} else {

0 commit comments

Comments
 (0)