Adds supports for RefreshTokens

This commit is contained in:
2025-04-17 04:33:28 -04:00
parent c19e2eb493
commit 16ae68a02e
28 changed files with 620 additions and 76 deletions

View File

@@ -13,7 +13,7 @@ public static class PasswordGenerator
private static readonly Random Random = new();
public static string GeneratePassword(
public static string Next(
int length = 15,
bool requireNumber = true,
bool requireLowercase = true,

View File

@@ -0,0 +1,14 @@
using System.Security.Cryptography;
namespace Hutopy.Web.Common.Security;
public static class RefreshTokenGenerator
{
public static string Next()
{
var randomNumber = new byte[32];
using var rng = RandomNumberGenerator.Create();
rng.GetBytes(randomNumber);
return Convert.ToBase64String(randomNumber);
}
}