login service by localstorg

This commit is contained in:
mmrbnjd
2024-04-18 18:26:12 +03:30
parent fa5a83d8d3
commit 77e004d090
11 changed files with 241 additions and 58 deletions

View File

@@ -0,0 +1,19 @@
using Shared.DTOs;
namespace Front.Services
{
public class localService
{
private readonly UserAuthenticationDTO _user;
public localService(UserAuthenticationDTO user)
{
_user = user;
}
public async Task<bool> OnlineUser()
{
if (_user != null && !string.IsNullOrEmpty(_user.Token) && _user.exitDate.AddMinutes(-5) > DateTime.Now)
return true;
return false;
}
}
}