public LoginApprovalManager(ILoginApprovalSessionStore sessionStore, IHttpContextAccessor httpContextAccessor, IOptions <LoginApprovalManagerOptions> optionsAccessor = null) { this.sessionStore = sessionStore; this.httpContextAccessor = httpContextAccessor; this.options = optionsAccessor?.Value ?? new LoginApprovalManagerOptions(); }
public static IServiceCollection AddLoginApprovals(this IServiceCollection services, ILoginApprovalSessionStore store) { services.AddHttpContextAccessor(); services.AddSingleton <ILoginApprovalSessionStore>(store); services.AddSingleton <LoginApprovalManager>(); return(services); }