public object redirectIfNotAuthenticated(ScriptScopeContext scope)
 {
     if (!isAuthenticated(scope))
     {
         var url = AuthenticateAttribute.GetHtmlRedirectUrl(req(scope));
         return(redirectTo(scope, url));
     }
     return(IgnoreResult.Value);
 }
 public object redirectIfNotAuthenticated(ScriptScopeContext scope, string path)
 {
     if (!isAuthenticated(scope))
     {
         var url = AuthenticateAttribute.GetHtmlRedirectUrl(req(scope), path, includeRedirectParam:true);
         return redirectTo(scope, url);
     }
     
     return IgnoreResult.Value;
 }
Пример #3
0
 public object redirectIfNotAuthenticated(ScriptScopeContext scope)
 {
     if (!isAuthenticated(scope))
     {
         var url = AuthenticateAttribute.GetHtmlRedirectUrl(req(scope));
         return(Context.DefaultMethods.@return(scope, new HttpResult(null, null, HttpStatusCode.Redirect)
         {
             Headers =
             {
                 [HttpHeaders.Location] = url
             }
         }));
     }
     return(IgnoreResult.Value);
 }