reeplace cerberos by talos

This commit is contained in:
Sergio Matias Urquin
2025-05-18 19:11:08 -06:00
parent f05d1a4b7e
commit 24efe5612c
45 changed files with 173 additions and 174 deletions

View File

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