This commit is contained in:
2019-01-18 18:39:24 +00:00
parent 43363e787c
commit 2b729a633f
4 changed files with 15 additions and 30 deletions

View File

@@ -28,6 +28,7 @@ namespace AyaNova.Api.Controllers
private readonly IConfiguration _configuration;
private readonly ApiServerState serverState;
private readonly IMetrics metrics;
private const int JWT_LIFETIME_DAYS=7;
/// <summary>
/// ctor
@@ -71,7 +72,7 @@ namespace AyaNova.Api.Controllers
}
int nFailedAuthDelay = 10000;
#if (DEBUG)
nFailedAuthDelay = 1;
@@ -185,7 +186,7 @@ namespace AyaNova.Api.Controllers
//create a new datetime offset of now in utc time
var iat = new DateTimeOffset(DateTime.Now.ToUniversalTime(), TimeSpan.Zero);//timespan zero means zero time off utc / specifying this is a UTC datetime
var exp = new DateTimeOffset(DateTime.Now.AddDays(30).ToUniversalTime(), TimeSpan.Zero);
var exp = new DateTimeOffset(DateTime.Now.AddDays(JWT_LIFETIME_DAYS).ToUniversalTime(), TimeSpan.Zero);
var payload = new Dictionary<string, object>()
{