Notes update + await warnings fix

master
Tudor Stanciu 2020-11-28 23:48:29 +02:00
parent 9259a53672
commit 62be9f4a50
2 changed files with 9 additions and 2 deletions

View File

@ -32,7 +32,7 @@ namespace NetworkResurrector.Application.Services
return null;
var token = $"{Guid.NewGuid()}-{Guid.NewGuid()}-{user.UserId}";
_securityStore.SetToken(token, user.UserId);
await Task.Run(() =>_securityStore.SetToken(token, user.UserId));
var securityToken = new SecurityToken() { UserId = user.UserId, Token = token };
return securityToken;
@ -40,7 +40,7 @@ namespace NetworkResurrector.Application.Services
public async Task<User> Authenticate(string token)
{
var tokenValidation = _securityStore.ValidateToken(token);
var tokenValidation = await Task.Run(() => _securityStore.ValidateToken(token));
if (tokenValidation.Success)
{
var user = _paramProvider.Users.FirstOrDefault(z => z.UserId == tokenValidation.UserId);

View File

@ -1,2 +1,9 @@
https://github.com/nikeee/wake-on-lan
#######################################################################################################################################################
Publish:
dotnet publish --configuration Release --runtime win7-x64
Create windows service:
sc create NetworkResurrector.Api binPath= "<path_to_the_service_executable>"
#######################################################################################################################################################