Skip to content

Commit d42aff9

Browse files
authored
Merge pull request #22 from magento-tsg/MC-40692
[Condor] MC-40692: 2FA Google Authenticator iPhone QR Code compatibility
2 parents 4cbf69f + 5f0dd97 commit d42aff9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

TwoFactorAuth/Model/Provider/Engine/Google.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ public function __construct(
9898
private function generateSecret(): string
9999
{
100100
$secret = random_bytes(128);
101-
return preg_replace('/[^A-Za-z0-9]/', '', Base32::encode($secret));
101+
// seed for iOS devices to avoid errors with barcode
102+
$seed = 'abcd';
103+
104+
return preg_replace('/[^A-Za-z0-9]/', '', Base32::encode($seed . $secret));
102105
}
103106

104107
/**

0 commit comments

Comments
 (0)