summaryrefslogtreecommitdiffstats
path: root/server/src/Data/Database/ApiAccessToken.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-06-12 14:24:10 +0200
committerivarlovlie <git@ivarlovlie.no>2022-06-12 14:24:10 +0200
commit9b6666e70829e3c341e709b1b0578603566d852b (patch)
tree3e84d9fc0dccb85b35f1001c40ac2a49b0b16e17 /server/src/Data/Database/ApiAccessToken.cs
parent7fa6822da7cfe5629275b3e2de26dd89556c960e (diff)
downloadgreatoffice-9b6666e70829e3c341e709b1b0578603566d852b.tar.xz
greatoffice-9b6666e70829e3c341e709b1b0578603566d852b.zip
refactor: Introduce AppDateTime and use it whenever we need to get current DateTime
This changes enables us to change timezones in testing
Diffstat (limited to 'server/src/Data/Database/ApiAccessToken.cs')
-rw-r--r--server/src/Data/Database/ApiAccessToken.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/Data/Database/ApiAccessToken.cs b/server/src/Data/Database/ApiAccessToken.cs
index 3eff5f3..a9cf0bc 100644
--- a/server/src/Data/Database/ApiAccessToken.cs
+++ b/server/src/Data/Database/ApiAccessToken.cs
@@ -8,7 +8,7 @@ public class ApiAccessToken : Base
public bool AllowCreate { get; set; }
public bool AllowUpdate { get; set; }
public bool AllowDelete { get; set; }
- public bool HasExpired => ExpiryDate < DateTime.UtcNow;
+ public bool HasExpired => ExpiryDate < AppDateTime.UtcNow;
public ApiAccessTokenDto AsDto => new(this);
public class ApiAccessTokenDto
@@ -26,6 +26,6 @@ public class ApiAccessToken : Base
public bool AllowCreate { get; set; }
public bool AllowUpdate { get; set; }
public bool AllowDelete { get; set; }
- public bool HasExpired => ExpiryDate < DateTime.UtcNow;
+ public bool HasExpired => ExpiryDate < AppDateTime.UtcNow;
}
}