Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a CSPRNG to generate the code verifier #99

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gotrue/Gotrue.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netstandard2.1</TargetFramework>
<PackOnBuild>true</PackOnBuild>
<PackageId>Supabase.Gotrue</PackageId>
<RootNamespace>Supabase.Gotrue</RootNamespace>
Expand Down
3 changes: 1 addition & 2 deletions Gotrue/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ public static string GenerateNonce()
{
// ReSharper disable once StringLiteralTypo
const string chars = "abcdefghijklmnopqrstuvwxyz123456789";
var random = new Random();
var nonce = new char[128];
for (var i = 0; i < nonce.Length; i++)
{
nonce[i] = chars[random.Next(chars.Length)];
nonce[i] = chars[RandomNumberGenerator.GetInt32(0, chars.Length)];
}

return new string(nonce);
Expand Down
Loading