Skip to content

Commit 5d3f344

Browse files
committed
MC-40692: 2FA Google Authenticator iPhone QR Code compatibility
1 parent 544b066 commit 5d3f344

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

TwoFactorAuth/Model/Provider/Engine/Google.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ 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+
return preg_replace('/[^A-Za-z0-9]/', '', Base32::encode($seed . $secret));
102104
}
103105

104106
/**

0 commit comments

Comments
 (0)