too many things to list (notably, user avatar update)

This commit is contained in:
sam 2024-07-08 19:03:04 +02:00
parent a7950671e1
commit d6c9345dba
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
20 changed files with 341 additions and 47 deletions

View file

@ -3,7 +3,7 @@ using Foxnouns.Backend.Database.Models;
namespace Foxnouns.Backend.Utils;
public static class OauthUtils
public static class AuthUtils
{
public const string ClientCredentials = "client_credentials";
public const string AuthorizationCode = "authorization_code";
@ -63,7 +63,6 @@ public static class OauthUtils
}
}
public static bool TryFromBase64String(string b64, out byte[] bytes)
{
try
@ -71,8 +70,9 @@ public static class OauthUtils
bytes = Convert.FromBase64String(b64);
return true;
}
catch
catch (Exception e)
{
Console.WriteLine($"Error converting string: {e}");
bytes = [];
return false;
}
@ -80,4 +80,6 @@ public static class OauthUtils
public static string RandomToken(int bytes = 48) =>
Convert.ToBase64String(RandomNumberGenerator.GetBytes(bytes)).Trim('=');
public const int MaxAuthMethodsPerType = 3; // Maximum of 3 Discord accounts, 3 emails, etc
}