Fix due tipologie di login

This commit is contained in:
Samuele Locatelli
2024-01-08 12:21:25 +01:00
parent 20ae251943
commit 1eb01b0532
12 changed files with 210 additions and 150 deletions
+27 -38
View File
@@ -53,30 +53,6 @@ namespace MP.Data.Services
#endregion Public Events
#if false
protected bool _tReset { get; set; } = false;
protected bool tReset
{
get => _tReset;
set
{
if (_tReset != value)
{
_tReset = value;
resetTimer();
}
}
}
protected void resetTimer()
{
if (EA_ResetFooterTimer != null)
{
EA_ResetFooterTimer?.Invoke();
}
}
#endif
#region Public Properties
public string CognomeNome
@@ -251,8 +227,6 @@ namespace MP.Data.Services
public async Task<bool> DoLogIn(string decodValue, bool saveOpr)
{
bool answ = false;
//expDays = SMService.GetConfInt("cookieDayExpire");
//var expDT = DateTime.Now.AddDays(expDays);
var devGuid = await GetCurrDevGuidLSAsync();
// decifro i valori..
var decrVal = DecryptData(decodValue);
@@ -306,6 +280,7 @@ namespace MP.Data.Services
}
return answ;
}
/// <summary>
/// Restituisce il record OperatoreDTO da localstorage
/// </summary>
@@ -351,6 +326,20 @@ namespace MP.Data.Services
return answ;
}
public TimeSpan GetKeyTTL(string redKey)
{
TimeSpan answ = new TimeSpan();
try
{
answ = redisDb.KeyTimeToLive(redKey) ?? new TimeSpan();
}
catch (Exception exc)
{
Log.Info($"Errore GetKeyTTL | currKey: {redKey}{Environment.NewLine}{exc}");
}
return answ;
}
/// <summary>
/// Restituisce ultima matrOpr registrata da localstorage
/// </summary>
@@ -440,17 +429,6 @@ namespace MP.Data.Services
return hasKey;
}
/// <summary>
/// scrive il record OperatoreDTO nel localstorage
/// </summary>
/// <returns></returns>
public async Task<bool> SetCurrOperDtoLSAsync(string currTkn)
{
bool answ = false;
await localStorage.SetItemAsync("currTkn", currTkn);
answ = true;
return answ;
}
/// <summary>
/// scrive il record Device GUID nel localstorage
/// </summary>
@@ -463,6 +441,18 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// scrive il record OperatoreDTO nel localstorage
/// </summary>
/// <returns></returns>
public async Task<bool> SetCurrOperDtoLSAsync(string currTkn)
{
bool answ = false;
await localStorage.SetItemAsync("currTkn", currTkn);
answ = true;
return answ;
}
/// <summary>
/// Scrive il valore di IPV4 del device nel localstoragee
/// </summary>
@@ -515,7 +505,6 @@ namespace MP.Data.Services
return answ;
}
/// <summary>
/// Recupero singola preferenza utente
/// </summary>