// ***********************************************************************
// 
//     AgileWebs
// 
// ***********************************************************************
using Microsoft.AspNetCore.Http;
using System.Security.Claims;
namespace Core.Thalos.Provider.Providers
{
    /// 
    /// Provides helper methods for common operations.
    /// 
    public static class Helper
    {
        /// 
        /// Retrieves the email address of the authenticated user from the HTTP context.
        /// 
        /// The IHttpContextAccessor instance to access the current HTTP context.
        /// The email address of the authenticated user, or an empty string if not available.
        public static string GetEmail(IHttpContextAccessor httpContextAccessor)
        {
            return httpContextAccessor.HttpContext?.User?.FindFirst(ClaimTypes.Email)?.Value ?? "";
        }
    }
}