token ValidFrom
parent
cc6784b073
commit
ee13545e61
|
@ -25,7 +25,9 @@ namespace IdentityServer.Application.Services
|
|||
return null;
|
||||
|
||||
var tokenRaw = $"{Guid.NewGuid()}-{Guid.NewGuid()}-{user.UserId}";
|
||||
var token = new Token() { Raw = tokenRaw, ValidUntil = DateTime.Now.AddMonths(12) };
|
||||
|
||||
var currentDate = DateTime.Now;
|
||||
var token = new Token() { Raw = tokenRaw, ValidFrom = currentDate, ValidUntil = currentDate.AddMonths(12) };
|
||||
_securityStore.SetToken(token, user.UserId);
|
||||
|
||||
return token;
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace IdentityServer.Domain.Models
|
|||
public class Token
|
||||
{
|
||||
public string Raw { get; set; }
|
||||
public DateTime ValidFrom { get; set; }
|
||||
public DateTime ValidUntil { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace IdentityServer.PublishedLanguage.Dto
|
|||
public class Token
|
||||
{
|
||||
public string Raw { get; set; }
|
||||
public DateTime ValidFrom { get; set; }
|
||||
public DateTime ValidUntil { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue