asp.net migration, fix resourcehosts2, remove admin panel

This commit is contained in:
Mikhail
2024-08-25 13:02:42 -04:00
parent d00ab6d185
commit 7a09c5960e
22 changed files with 578 additions and 262 deletions

View File

@@ -6,6 +6,26 @@ namespace EpinelPS.Utils
{
public class NetUtils
{
public static (User?, AccessToken?) GetUser(string tokToCheck)
{
if (string.IsNullOrEmpty(tokToCheck))
throw new Exception("missing auth token");
foreach (var tok in JsonDb.Instance.LauncherAccessTokens)
{
if (tok.Token == tokToCheck)
{
var user = JsonDb.Instance.Users.Find(x => x.ID == tok.UserID);
if (user != null)
{
return (user, tok);
}
}
}
return (null, null);
}
public static NetUserItemData ToNet(ItemData item)
{
return new()