Пример #1
0
        protected override void ProcessRequestCore(HttpContext context)
        {
            CheckFor.HttpHandlerBase.ProcessRequestCore(context);

            new AuthenticationService(context).SignOut();

            var nextUrl = _siteMapFactory.CreateMap(ChiffonContext.Resolve(HttpContext.Current).Environment).Home().AbsoluteUri;

            context.Response.Redirect(nextUrl);
        }
Пример #2
0
        protected override void ProcessRequestCore(HttpContext context, Maybe <Uri> query)
        {
            CheckFor.HttpHandlerBase.ProcessRequestCore(context, query);

            var environment = ChiffonContext.Resolve(HttpContext.Current).Environment;
            var siteMap     = _siteMapFactory.CreateMap(environment);

            new AuthenticationService(context).SignIn(Member.Anonymous);

            var nextUrl = query.Select(_ => environment.MakeAbsoluteUri(_)).ValueOrElse(siteMap.Home());

            context.Response.Redirect(nextUrl.AbsoluteUri);
        }
Пример #3
0
        protected override void ProcessRequestCore(HttpContext context, LogOnQuery query)
        {
            CheckFor.HttpHandlerBase.ProcessRequestCore(context, query);

            var environment = ChiffonContext.Resolve(HttpContext.Current).Environment;
            var siteMap     = _siteMapFactory.CreateMap(environment);

            var member = _memberService
                         .MayLogOn(query.Email, query.Password);

            member.OnSome(_ => new AuthenticationService(context).SignIn(_));

            var nextUrl = member
                          .Select(_ => GetNextUri_(query.TargetUrl, siteMap, environment))
                          .ValueOrElse(GetLoginUri_(query.TargetUrl, siteMap));

            context.Response.Redirect(nextUrl.AbsoluteUri);
        }