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

25 lines
676 B
C#

using BlueWest.Data.Auth;
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;
}
}
}