using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication;
using System.Net;

namespace Yuna.Website.Server.Infrastructure
{
    public class HttpHelper
    {
        public static Func<RedirectContext<CookieAuthenticationOptions>, Task> BypassWithStatusCode(HttpStatusCode statusCode)
        {
            return context =>
            {
                context.Response.StatusCode = (int)statusCode;
                return Task.CompletedTask;
            };
        }

        public static Func<RedirectContext<CookieAuthenticationOptions>, Task> BypassWithStatusCode(int statusCode)
        {
            return context =>
            {
                context.Response.StatusCode = statusCode;
                return Task.CompletedTask;
            };
        }
    }
}
