Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need a way to intercept exception to send http 401 #118

Open
luzik opened this issue Oct 28, 2020 · 0 comments
Open

Need a way to intercept exception to send http 401 #118

luzik opened this issue Oct 28, 2020 · 0 comments

Comments

@luzik
Copy link

luzik commented Oct 28, 2020

Description

I can't find a way to mix @api.dispatcher.add_method with @jwt_required from flask-jwt-extended

Steps to Reproduce

@api.dispatcher.add_method
@jwt_required
def rpc_test(param: str) -> str:
      return 'mucha %s ' % param

@app.route('/test')
@jwt_required
def test():
     return 'tesss'

Expected behavior: [What you expect to happen]

Unauthorized call for rpc_test return 401 code

Actual behavior: [What actually happens]

Unauthorized call for rpc_test return 200 code with data:
{"error": {"code": -32000, "message": "Server error", "data": {"type": "NoAuthorizationError", "args": ["Missing cookie "access_token_cookie""], "message": "Missing cookie "access_token_cookie""}}, "id": 4, "jsonrpc": "2.0"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant