CodeLiturgy.Dashboard/BlueWest.Api/Session/SessionExtensions.cs

25 lines
676 B
C#
Raw Normal View History

2022-09-27 20:12:13 +03:00
using BlueWest.Data.Auth;
2022-09-19 05:50:15 +03:00
using Microsoft.AspNetCore.Http;
namespace BlueWest.WebApi.Controllers
{
public static class SessionExtensions
{
/// <summary>
/// Check for the session token header
/// </summary>
/// <param name="headerDictionary"></param>
/// <returns></returns>
public static string GetSessionTokenHeader(this IHeaderDictionary headerDictionary)
{
if (headerDictionary.ContainsKey(SessionConstants.SessionTokenHeaderName))
{
return headerDictionary[SessionConstants.SessionTokenHeaderName];
}
return string.Empty;
}
}
}