[CHANGE] Improved hash auth token gen. Added new cookie rotate
This commit is contained in:
parent
88e724099c
commit
9e81e221c6
2 changed files with 31 additions and 13 deletions
|
|
@ -30,8 +30,18 @@ public static class AuthenticationUtilities
|
|||
{
|
||||
throw new ArgumentNullException(nameof(origin));
|
||||
}
|
||||
|
||||
datasyncId = datasyncId.Replace("||", "");
|
||||
|
||||
if (datasyncId.Contains("||", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var ids = datasyncId.Split("||", StringSplitOptions.RemoveEmptyEntries);
|
||||
datasyncId = ids.Length switch
|
||||
{
|
||||
1 => ids[0],
|
||||
2 => ids[1],
|
||||
_ => datasyncId
|
||||
};
|
||||
}
|
||||
|
||||
sapisid = Uri.UnescapeDataString(sapisid);
|
||||
if (string.IsNullOrWhiteSpace(time))
|
||||
{
|
||||
|
|
@ -52,7 +62,7 @@ public static class AuthenticationUtilities
|
|||
private static string GetTime()
|
||||
{
|
||||
var st = new DateTime(1970, 1, 1);
|
||||
var t = DateTime.Now.ToUniversalTime() - st;
|
||||
var t = DateTime.UtcNow - st;
|
||||
var time = (t.TotalMilliseconds + 0.5).ToString(CultureInfo.InvariantCulture);
|
||||
return time[..10];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue