Skip to content

flask-security-too integrations with flask-smorest #785

Closed Answered by jwag956
pejmanS21 asked this question in Q&A
Discussion options

You must be logged in to vote

You can't decorate a class since that will cause the class itself to be returned (which is what the error is saying).
I think you are using Flask.views - in that case something like this should work:

` class MyView(MethodView):
decorators = [auth_required("token", "session")]

    def get(self):
        return render_template_string("Hi view")`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pejmanS21
Comment options

Answer selected by pejmanS21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants