Skip to content

Commit

Permalink
PM-12613 - Add temp logging to help debug integration test failure in…
Browse files Browse the repository at this point in the history
… pipeline
  • Loading branch information
JaredSnider-Bitwarden committed Oct 23, 2024
1 parent 1a74636 commit 0cd5308
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Core/Utilities/CoreHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,18 @@ public static bool TokenIsValid(string firstTokenPart, IDataProtector protector,
try
{
var unprotectedData = protector.Unprotect(token);
Console.WriteLine($"Unprotected data: {unprotectedData}");
var dataParts = unprotectedData.Split(' ');
if (dataParts.Length == 4 && dataParts[0] == firstTokenPart &&
new Guid(dataParts[1]) == id &&
dataParts[2].Equals(userEmail, StringComparison.InvariantCultureIgnoreCase))
{
Console.WriteLine($"Time check");

var creationTime = FromEpocMilliseconds(Convert.ToInt64(dataParts[3]));
var expTime = creationTime.AddHours(expirationInHours);

Console.WriteLine($" expTime < DateTime.UtcNow: {expTime < DateTime.UtcNow}");
invalid = expTime < DateTime.UtcNow;
}
}
Expand Down

0 comments on commit 0cd5308

Please sign in to comment.