1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Added updating of Last Seen on login

This commit is contained in:
Uncled1023 2019-01-28 20:08:48 -08:00
parent 54398fbe29
commit b5c02f7640

View File

@ -110,6 +110,9 @@ namespace Teknik.IdentityServer.Controllers
if (result.Succeeded)
{
foundUser.LastSeen = DateTime.Now;
await _userManager.UpdateAsync(foundUser);
// make sure the returnUrl is still valid, and if so redirect back to authorize endpoint or a local page
if (_interaction.IsValidReturnUrl(returnUrl) || Url.IsLocalUrl(returnUrl))
{
@ -179,6 +182,9 @@ namespace Teknik.IdentityServer.Controllers
if (result.Succeeded)
{
user.LastSeen = DateTime.Now;
await _userManager.UpdateAsync(user);
return RedirectToLocal(returnUrl);
}
else if (result.IsLockedOut)