rscarrera27 / Sanic-JWT-Extended

⚡️An open source Sanic extension that provides "extended" JWT support
https://sanic-jwt-extended.seonghyeon.dev
MIT License
35 stars 8 forks source link

modify way to get request considering class view #3

Closed sjquant closed 5 years ago

sjquant commented 5 years ago

Problem

sanic_jwt_extend.jwt_required only works for function view. It does not work for class based view like HTTPMethodView.

Expected Behavior

it should work for HTTPMethodView. It contains request object in the second args

Proposed Solution

I created _get_request function, which checks the type of args and get request object.

rscarrera27 commented 5 years ago

Good! Thanks for your PR :heart_eyes: