Flask API blocking OPTIONS requests
<p>I have an API written in Flask, when I am trying to use this API from AngularJS I am getting an 401 error unauthorized, same request with same credentials is working fine from Postman or HTTPie. This is happening with GET or POST request.</p>

<p>I noticed that the difference between HTTPie and Angular request is that Angular is calling OPTIONS before a GET request.</p>

<p>This is my python code where authentication is required(api is a blueprint):</p>

<pre><code>@api.before_request
@rate_limit(limit=5, period=15)
@auth_token.login_required
def before_request():
   """All routes in this blueprint require authentication."""
   pass
</code></pre>

<p>The only method that is working from my api is one that is outside of this blueprint, my conclusion is that the @api.before_request and @auth_token.login_required are expecting credentials to be sent for the OPTIONS request, any idea what can I do?</p>

<p>Thank you very much</p>

<p>I figure out the problem, I solved after updating the plugin Flask-HTTPAuth.</p>

<p>I was having the version 2.2.1 and after moving to 3.2.1 it solved.</p>

<p>Tried the same on an instance of Amazon EC2 and solved with the same solution so I am quite sure it was this.</p>

python angularjs flask restful-architecture