title: How to check if user is authorized inside Action
body: <p>Usually I protect my Actions with <code>[Authorize]</code> but this time I need to check if a user is authorized inside the action.</p>
  
  <p>Eg</p>
  
  <pre><code>if(userIsAuthorized) {
      //do stuff
  }
  else {
      //return to login page
  }
  </code></pre>
  
  <p><strike>I believe</strike> I am using 'Forms Authentication'</p>
  
  <p>This question is kind of similar to <a href="https://stackoverflow.com/questions/1332132/check-if-user-is-logged-in-in-user-control-asp-net-mvc">this</a> but none of the answers given seemed to work.</p>
  
  <p>EDIT: I have done some more digging- it seems if I breakpoint on an Action that has <code>[Authorize]</code>, the User.Identity is set, but on Actions without it, the User.Identity is empty, even if I am logged in</p>