Browse Source

Added updating of Last Seen on login

master
Teknikode 9 months ago
parent
commit
b5c02f7640
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      IdentityServer/Controllers/AccountController.cs

+ 6
- 0
IdentityServer/Controllers/AccountController.cs 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)

Loading…
Cancel
Save