Пример #1
0
        protected IHttpResult RedirectDueToFailure(IServiceBase authService, IAuthSession session, NameValueCollection errorInfo)
        {
            FailAndLogError(session, errorInfo);
            var baseUrl     = authService.Request.GetBaseUrl();
            var destination = !FailureRedirectPath.IsNullOrEmpty() ?
                              baseUrl + FailureRedirectPath :
                              session.ReferrerUrl ?? baseUrl;
            var fparam = errorInfo["error"] ?? "Unknown";

            return(authService.Redirect(FailedRedirectUrlFilter(this, destination.SetParam("f", fparam))));
        }
        protected IHttpResult RedirectDueToFailure(IServiceBase authService, IAuthSession session,
                                                   NameValueCollection errorInfo)
        {
            FailAndLogError(session, errorInfo);
            var baseUrl = new Uri(authService.Request.AbsoluteUri).GetComponents(UriComponents.SchemeAndServer,
                                                                                 UriFormat.SafeUnescaped); // .Request.GetBaseUrl();
            var destination = !FailureRedirectPath.IsNullOrEmpty()
                ? baseUrl + FailureRedirectPath
                : session.ReferrerUrl ?? baseUrl;
            var fparam = errorInfo["error"] ?? "Unknown";

            return(authService.Redirect(FailedRedirectUrlFilter(this, $"{destination}?f={fparam}&response_type=code")));
        }