0

This might be a Python newbie question (i.e., not understanding decorators).

I have a view class that I want to protect by requiring OAuth authentication (I have all of the OAuth stuff set-up and working).

The docs say do this:

@app.route('/api/user')
@oauth.require_oauth('email', 'username')
def user():
    return jsonify(request.oauth.user)

But I have a MethodView class:

@inject(oauth=OAuth)
class MyView(flask.views.MethodView):
    def get(self):
        pass

I can inject the OAuth object, but how do I use it to achieve the same effect?

rsb
  • 1,020
  • 1
  • 10
  • 25

1 Answers1

0

My mistake. I think @oauth.require_oauth is meant only for OAuth providers.

rsb
  • 1,020
  • 1
  • 10
  • 25