Giter Club home page Giter Club logo

flask-jwt-extended-section-lectures's People

Contributors

jslvtr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

flask-jwt-extended-section-lectures's Issues

Postman-related Errors (?)

Hi Jose, I just completed your course and it's been really great! I'm having some bugs with postman, which I believe are related to the settings like Headers, Body, etc.

For instance, I'm getting this error for POST {{url}}/logout:

Traceback (most recent call last):
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2095, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2080, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 471, in wrapper
    return self.make_response(data, code, headers=headers)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 500, in make_response
    resp = self.representations[mediatype](data, *args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/representations/json.py", line 21, in output_json
    dumped = dumps(data, **settings) + "\n"
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/json/__init__.py", line 234, in dumps
    return cls(
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '

And this error for POST {{url}}/refresh:

Traceback (most recent call last):
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2095, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2080, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_jwt_extended/view_decorators.py", line 153, in decorator
    verify_jwt_in_request(optional, fresh, refresh, locations, verify_type)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_jwt_extended/view_decorators.py", line 89, in verify_jwt_in_request
    jwt_data, jwt_header, jwt_location = _decode_jwt_from_request(
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_jwt_extended/view_decorators.py", line 349, in _decode_jwt_from_request
    verify_token_not_blocklisted(jwt_header, decoded_token)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_jwt_extended/internal_utils.py", line 42, in verify_token_not_blocklisted
    if jwt_manager._token_in_blocklist_callback(jwt_header, jwt_data):
TypeError: check_if_token_in_blacklist() takes 1 positional argument but 2 were given

And this error for GET {{url}}/item/chair:

Traceback (most recent call last):
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2095, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2080, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 271, in error_router
    return original_handler(e)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask/views.py", line 84, in view
    return current_app.ensure_sync(self.dispatch_request)(*args, **kwargs)
  File "/Users/wilsonchan/opt/anaconda3/envs/flask/lib/python3.9/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
TypeError: wrapper() got an unexpected keyword argument 'name'

For all 3 of these error messages, in the Headers, KEY is Authorization and VALUE is Bearer {{jwt_refresh_token}}
POST {{url}}/register and POST {{url}}/login work as expected, but I haven't tried the other endpoints.

Following your endpoint configs in Postman was a bit difficult in this section of the course - is there a way I can import your configs to make sure the code works on my end?

Thank you for reading!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.