rama creada apartir de master en j
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
|
||||
namespace adas_core.Domain.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Provides a set of static utility methods for authentication-related operations.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class is sealed and cannot be inherited.
|
||||
/// </remarks>
|
||||
public sealed class AuthUtils
|
||||
{
|
||||
private LoginResponse _loginResponse = new();
|
||||
@@ -37,11 +43,15 @@ public sealed class AuthUtils
|
||||
private static AuthUtils InternalInstance { get; set; }
|
||||
public static AuthUtils Instance => InternalInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the current <see cref="LoginResponse"/> in a thread-safe manner by acquiring a lock on the underlying field.
|
||||
/// </summary>
|
||||
/// <returns>The current <see cref="LoginResponse"/> instance.</returns>
|
||||
public LoginResponse GetLoginResponse()
|
||||
{
|
||||
lock (_loginResponse)
|
||||
{
|
||||
return _loginResponse;
|
||||
lock (_loginResponse)
|
||||
{
|
||||
return _loginResponse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user