mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
38 lines
No EOL
1.3 KiB
C#
38 lines
No EOL
1.3 KiB
C#
using Nancy;
|
|
using Nancy.Authentication.Forms;
|
|
using Nancy.Bootstrapper;
|
|
using Nancy.TinyIoc;
|
|
|
|
using RequestPlex.Core;
|
|
|
|
using FormsAuthentication = Nancy.Authentication.Forms.FormsAuthentication;
|
|
|
|
namespace RequestPlex.UI
|
|
{
|
|
public class Bootstrapper : DefaultNancyBootstrapper
|
|
{
|
|
// The bootstrapper enables you to reconfigure the composition of the framework,
|
|
// by overriding the various methods and properties.
|
|
// For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper
|
|
|
|
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
|
|
{
|
|
base.ConfigureRequestContainer(container, context);
|
|
container.Register<IUserMapper, UserMapper>();
|
|
}
|
|
|
|
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
|
{
|
|
base.ApplicationStartup(container, pipelines);
|
|
|
|
// Enable forms auth
|
|
var formsAuthConfiguration = new FormsAuthenticationConfiguration
|
|
{
|
|
RedirectUrl = "~/login",
|
|
UserMapper = container.Resolve<IUserMapper>()
|
|
};
|
|
|
|
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
|
}
|
|
}
|
|
} |