public static IApplicationBuilder UseEmuses(this IApplicationBuilder builder, Action <EmusesOptions> setupAction) { var options = new EmusesOptions(); setupAction?.Invoke(options); return(builder.UseMiddleware <EmusesMiddleware>(options)); }
public EmusesMiddleware(RequestDelegate next, EmusesOptions emusesConfiguration) { _configuration = emusesConfiguration; if (_configuration.NoSessionAccessPages == null) { _configuration.NoSessionAccessPages = new List <string>(); } _configuration.NoSessionAccessPages.Add(_configuration.SessionExpiredPage); if (_configuration.LoginPage == null) { _configuration.LoginPage = LoginPage; } _next = next; }