Ejemplo n.º 1
0
        public Task RedirectTo(object input, string categoryOrHttpMethod = null)
        {
            string url = input as string ?? _registry.UrlFor(input, categoryOrHttpMethod ?? "GET");

            _writer.RedirectToUrl(url);

            // TODO -- use an async write method on the HTTP?
            return(Task.CompletedTask);
        }
        protected override void invoke(Action action)
        {
            _trace.Start();

            try
            {
                action();
            }
            catch (Exception ex)
            {
                _trace.MarkAsFailedRequest();

                if (!_exceptionObserver.WasObserved(ex))
                {
                    _trace.Log(new ExceptionReport("Request failed", ex));
                    _exceptionObserver.RecordHandled(ex);
                }

                throw;
            }
            finally
            {
                _trace.MarkFinished();

                if (_detector.IsDebugCall())
                {
                    _writer.RedirectToUrl(_trace.LogUrl);
                }
            }
        }
Ejemplo n.º 3
0
        public void RedirectToUrl(string url)
        {
            _report.AddDetails(new RedirectReport()
            {
                Url = url
            });

            _inner.RedirectToUrl(url);
        }
        protected override DoNext performInvoke()
        {
            if (_fubuRequest.Has <TOutput>() && _fubuRequest.Get <TOutput>() != null)
            {
                return(DoNext.Continue);
            }
            var model = _fubuRequest.Get <NotFoundModel>();
            var url   = _urlRegistry.UrlFor(model);

            _outputWriter.RedirectToUrl(url);
            return(DoNext.Stop);
        }
        public void Success(IOAuth2Response response)
        {
            var login = _request.Get <T>();
            var url   = login.Url;

            if (url.IsEmpty())
            {
                url = "~/";
            }

            _writer.RedirectToUrl(url);
        }
        public void Success()
        {
            var login = _request.Get <TwitterLoginRequest>();
            var url   = login.Url;

            if (url.IsEmpty())
            {
                url = "~/";
            }

            _writer.RedirectToUrl(url);
        }
        public void Handle()
        {
            if (_requestData.IsAjaxRequest())
            {
                _writer.WriteResponseCode(HttpStatusCode.Forbidden);
                return;
            }

            //ICK - working around Fubu Url building bug
            //var loginUrl = _urlRegistry.UrlFor(new SignInRequest {ReturnUrl = _currentHttpRequest.RawUrl()}); //this is what it should be

            //redirect to login url
            var loginUrl = _urlRegistry.UrlFor(new SignInRequest());

            loginUrl = loginUrl.TrimEnd('/') + "?ReturnUrl=" + _currentHttpRequest.RawUrl().UrlEncode();

            _writer.RedirectToUrl(loginUrl);
        }
Ejemplo n.º 8
0
        public void RedirectTo(object input)
        {
            string url = input as string ?? _registry.UrlFor(input);

            _writer.RedirectToUrl(url);
        }
Ejemplo n.º 9
0
 public void Handle()
 {
     _outputWriter.RedirectToUrl(_urlRegistry.UrlFor <AuthorizationFailureInputModel>());
 }
Ejemplo n.º 10
0
 public void RedirectToUrl(string url)
 {
     _inner.RedirectToUrl(url);
 }
Ejemplo n.º 11
0
        public void RedirectTo(object input, string categoryOrHttpMethod = null)
        {
            string url = input as string ?? _registry.UrlFor(input, categoryOrHttpMethod ?? "GET");

            _writer.RedirectToUrl(url);
        }
Ejemplo n.º 12
0
 public void Handle()
 {
     _writer.RedirectToUrl(_urls.UrlFor(PassportConfiguration.LogonRouteInputModel));
 }