Redo the auth system and implement rate limits
This commit is contained in:
@@ -8,4 +8,12 @@ public class WebinterfaceUtil
|
||||
{
|
||||
return (100000 + Rng.Next() % 100000).ToString()[1..];
|
||||
}
|
||||
|
||||
public static string GenerateSimpleToken()
|
||||
{
|
||||
var buffer = new byte[15];
|
||||
Rng.NextBytes(buffer);
|
||||
|
||||
return Convert.ToHexString(buffer);
|
||||
}
|
||||
}
|
||||
@@ -8,4 +8,7 @@ public static class WrapperUtil
|
||||
{
|
||||
Plugin.Notification.AddNotification(new Notification { Content = content, Type = type, Minimized = minimized });
|
||||
}
|
||||
|
||||
public static IEnumerable<(T Value, int Index)> WithIndex<T>(this IEnumerable<T> list)
|
||||
=> list.Select((x, i) => (x, i));
|
||||
}
|
||||
Reference in New Issue
Block a user