-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from BrandonPotter/feature/Net60Release
v2.5 release candidate
- Loading branch information
Showing
3 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,13 @@ public SetupCode GenerateSetupCode(string issuer, | |
throw new NullReferenceException("Account Title is null"); | ||
} | ||
|
||
// MS wants us to change this to use EscapeDataString - https://docs.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib0013 | ||
// But that changes the output. Specifically "[email protected]" becomes "a%40b.com" | ||
// See issue https://github.com/BrandonPotter/GoogleAuthenticator/issues/103 | ||
#pragma warning disable SYSLIB0013 | ||
accountTitleNoSpaces = RemoveWhitespace(Uri.EscapeUriString(accountTitleNoSpaces)); | ||
#pragma warning restore SYSLIB0013 | ||
|
||
var encodedSecretKey = Base32Encoding.ToString(accountSecretKey); | ||
|
||
var provisionUrl = string.IsNullOrWhiteSpace(issuer) | ||
|
@@ -81,7 +87,7 @@ private static string GenerateQrCodeUrl(int qrPixelsPerModule, string provisionU | |
var qrCodeUrl = ""; | ||
try | ||
{ | ||
using (var qrGenerator = new QRCodeGenerator()) | ||
using (var qrGenerator = new QRCodeGenerator()) | ||
using (var qrCodeData = qrGenerator.CreateQrCode(provisionUrl, QRCodeGenerator.ECCLevel.Q)) | ||
#if NET6_0 | ||
using (var qrCode = new PngByteQRCode(qrCodeData)) | ||
|
@@ -98,7 +104,6 @@ private static string GenerateQrCodeUrl(int qrPixelsPerModule, string provisionU | |
qrCodeUrl = $"data:image/png;base64,{Convert.ToBase64String(ms.ToArray())}"; | ||
} | ||
#endif | ||
|
||
} | ||
catch (TypeInitializationException e) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters