File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function create(string $migrationPayload) : Migrator
3030 return App::make (AegisMigrator::class);
3131 } elseif ($ this ->is2FASv2 ($ migrationPayload )) {
3232 return App::make (TwoFASMigrator::class);
33- } elseif ($ this -> isGoogleAuth ($ migrationPayload )) {
33+ } elseif (self :: isGoogleAuth ($ migrationPayload )) {
3434 return App::make (GoogleAuthMigrator::class);
3535 } elseif ($ this ->isBitwardenJson ($ migrationPayload )) {
3636 return App::make (BitwardenMigrator::class);
@@ -46,7 +46,7 @@ public function create(string $migrationPayload) : Migrator
4646 *
4747 * @param string $migrationPayload The payload to analyse
4848 */
49- private function isGoogleAuth (string $ migrationPayload ) : bool
49+ public static function isGoogleAuth (string $ migrationPayload ) : bool
5050 {
5151 // - Google Auth migration URI : a string starting with otpauth-migration://offline?data= on a single line
5252
Original file line number Diff line number Diff line change 22
33namespace App \Services ;
44
5+ use App \Factories \MigratorFactory ;
56use chillerlan \QRCode \QRCode ;
67use chillerlan \QRCode \QROptions ;
78use Illuminate \Support \Facades \Log ;
@@ -68,7 +69,10 @@ public static function decode(\Illuminate\Http\UploadedFile $file)
6869 }
6970 }
7071
71- $ data = urldecode ($ text );
72+ $ data = $ text ;
73+ if (!MigratorFactory::isGoogleAuth ($ text )) {
74+ $ data = urldecode ($ text );
75+ }
7276
7377 Log::info ('QR code decoded ' );
7478
You can’t perform that action at this time.
0 commit comments