melihcolpan/flask-restful-login

Cannot access login route

akbari59 opened this issue · 3 comments

I am learning flask and I tried it out with your repository. I can register a user but I cannot login with the same user using. Following is the stack trace, do you have any idea? I used curl to send request.

Thanks in advance.,

Traceback (most recent call last):
  File "_pydevd_frame_eval/pydevd_frame_evaluator_darwin_37_64.pyx", line 95, in _pydevd_frame_eval.pydevd_frame_evaluator_darwin_37_64.get_bytecode_while_frame_eval

KeyError: '/Users/mohammad/anaconda3/envs/py37/lib/python3.7/base64.py'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask_restful/__init__.py", line 269, in error_router
    return original_handler(e)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/_compat.py", line 38, in reraise
    raise value.with_traceback(tb)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask_restful/__init__.py", line 462, in wrapper
    return self.make_response(data, code, headers=headers)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask_restful/__init__.py", line 491, in make_response
    resp = self.representations[mediatype](data, *args, **kwargs)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/site-packages/flask_restful/representations/json.py", line 21, in output_json
    dumped = dumps(data, **settings) + "\n"
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/encoder.py", line 201, in encode
    chunks = list(chunks)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/encoder.py", line 431, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict
    yield from chunks
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/encoder.py", line 438, in _iterencode
    o = _default(o)
  File "/Users/mohammad/anaconda3/envs/py37/lib/python3.7/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type bytes is not JSON serializable

Hello,

I have the same issue when accessing the login route. Do you have an update about that ?

Btw, thanks a lot for this inspiring project and thanks in advance for your time

Hello Tishacian and Akbari,

I included it in the planning, but unfortunately it has gone unnoticed. I published the fix, thank you for reporting.

Cordially