summaryrefslogtreecommitdiffstats
path: root/server/src/Endpoints/Internal/PasswordResetRequests
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/Endpoints/Internal/PasswordResetRequests
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/Endpoints/Internal/PasswordResetRequests')
-rw-r--r--server/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs b/server/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs
index 3e086f6..1c2a51b 100644
--- a/server/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs
+++ b/server/src/Endpoints/Internal/PasswordResetRequests/CreateResetRequestRoute.cs
@@ -34,12 +34,12 @@ public class CreateResetRequestRoute : RouteBaseAsync.WithRequest<string>.WithAc
// this is fine as long as the client is not connecting from Australia: Lord Howe Island
// according to https://en.wikipedia.org/wiki/Daylight_saving_time_by_country
- if (tz.IsDaylightSavingTime(DateTime.UtcNow)) {
+ if (tz.IsDaylightSavingTime(AppDateTime.UtcNow)) {
offset++;
}
_logger.LogInformation("Request time zone (" + tz.Id + ") offset is: " + offset + " hours");
- var requestDateTime = TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, tz);
+ var requestDateTime = TimeZoneInfo.ConvertTimeFromUtc(AppDateTime.UtcNow, tz);
_logger.LogInformation("Creating forgot password request with date time: " + requestDateTime.ToString("u"));
try {