aboutsummaryrefslogtreecommitdiff
path: root/Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-04-13 11:40:22 -0400
committerLibravatar vnugent <public@vaughnnugent.com>2023-04-13 11:40:22 -0400
commitb3e34b4a8833511584553a5c12eb20fd383b0d2c (patch)
tree8c92ef66e86722699dc6b130b00fca05bef00aec /Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens
parentff6283f68d921685fd7730384b0790dfcc2c7d64 (diff)
Extension updates with database creation
Diffstat (limited to 'Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens')
-rw-r--r--Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens/TokenStore.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens/TokenStore.cs b/Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens/TokenStore.cs
index 10beefc..f160a79 100644
--- a/Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens/TokenStore.cs
+++ b/Libs/VNLib.Plugins.Essentials.Oauth/src/Tokens/TokenStore.cs
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2022 Vaughn Nugent
+* Copyright (c) 2023 Vaughn Nugent
*
* Library: VNLib
* Package: VNLib.Plugins.Essentials.Oauth
@@ -23,10 +23,10 @@
*/
using System;
-using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
@@ -81,14 +81,16 @@ namespace VNLib.Plugins.Essentials.Oauth.Tokens
return count;
}
+ DateTime now = DateTime.UtcNow;
+
//Try to add the new token
ActiveToken newToken = new()
{
ApplicationId = appId,
Id = token,
RefreshToken = refreshToken,
- Created = DateTime.UtcNow,
- LastModified = DateTime.UtcNow
+ Created = now,
+ LastModified = now,
};
//Add token to store
ctx.OAuthTokens.Add(newToken);