Issue #11 resolved

@oauth_required decorator cannot be parametrized

bborowin
created an issue

The current implementation of the @oauth_required decorator does not allow parametrizing it, even though the source code suggests it would (eg, to add resource name)

In my fork, I've implemented a small tweak to allow the parameter: https://bitbucket.org/bborowin/django-oauth-plus/changeset/3ab50cdf10e9

Comments (2)

  1. Michał Jaworski

    fixed in c052177

    bborowin: used your idea as foundation but I still needed some trick to make argument fully optional. Now oauth_required can be used with and without resource name parameter:

    @oauth_required
    def some_view(request)
        (...)
    
    @oauth_required()
    def some_view(request)
        (...)
    
    @oauth_required('resource name')
    def some_view(request)
        (...)
    
  2. Log in to comment