Open Aaron-Ochieng opened 2 years ago
If you are using flask-security-too it has a complete openapi spec: https://flask-security-too.readthedocs.io/en/stable/_static/openapi_view.html#auth
Still not helping.On 20 May 2022 6:48 am, Chris Wagner @.***> wrote: If you are using flask-security-too it has a complete openapi spec: https://flask-security-too.readthedocs.io/en/stable/_static/openapi_view.html#auth
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
Flask-Security-Too has a default_unauthn_handler that returns JSON if the request was JSON or is asking (via Accept header). You can see more details here: https://flask-security-too.readthedocs.io/en/stable/customizing.html?highlight=auth_required#oh-my
If you are still having issues - please take the discussion over to: https://github.com/Flask-Middleware/flask-security/discussions
and provide some code that is failing.
I need @auth_required decorator to return JSON response instead of HTML since I'm working with SPA. Can anyone help me by giving a simple example please. I'm stuck guys with the documentation.