INFO:werkzeug:[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m
 * Running on http://127.0.0.1:5000
INFO:werkzeug:[33mPress CTRL+C to quit[0m
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:09] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /shutdown [GET]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\serve.py", line 23, in be_shutdown
    shutdown_server()
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\serve.py", line 17, in shutdown_server
    raise RuntimeError("Not running with the Werkzeug Server")
RuntimeError: Not running with the Werkzeug Server
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:52:10] "[35m[1mGET /shutdown HTTP/1.1[0m" 500 -
INFO:werkzeug:[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m
 * Running on http://127.0.0.1:5000
INFO:werkzeug:[33mPress CTRL+C to quit[0m
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:24] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /auth/register [POST]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\view\auth.py", line 35, in register
    code, message = u.register(user_id=user_id, password=password)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 59, in register
    token = jwt_encode(user_id, terminal)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\model\user.py", line 22, in jwt_encode
    return encoded.decode("utf-8")
           ^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mPOST /auth/register HTTP/1.1[0m" 500 -
ERROR:be.serve:Exception on /shutdown [GET]
Traceback (most recent call last):
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\venv\Lib\site-packages\flask\app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\serve.py", line 23, in be_shutdown
    shutdown_server()
  File "C:\Users\22924\CDMS.Xuan_ZHOU.2024Fall.DaSE\project1\bookstore\be\serve.py", line 17, in shutdown_server
    raise RuntimeError("Not running with the Werkzeug Server")
RuntimeError: Not running with the Werkzeug Server
INFO:werkzeug:127.0.0.1 - - [10/Oct/2024 10:58:25] "[35m[1mGET /shutdown HTTP/1.1[0m" 500 -
