mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-22 20:04:45 +01:00
asp.net migration, fix resourcehosts2, remove admin panel
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user