Refresh Endpoint errors with 500 when the refresh token is invalid
Stacktrace:
2021-07-09T15:12:30.387 INFO [gunicorn] [2021-07-09 13:12:30 +0000] [27] [DEBUG] GET /api/auth/refresh
2021-07-09T15:12:30.451 INFO [gunicorn] [ERROR] Internal Server Error: /api/auth/refresh
2021-07-09T15:12:30.451 INFO [gunicorn] Traceback (most recent call last):
2021-07-09T15:12:30.451 INFO [gunicorn] File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/exception.py", line 47, in inner
2021-07-09T15:12:30.451 INFO [gunicorn] response = get_response(request)
2021-07-09T15:12:30.451 INFO [gunicorn] File "/usr/local/lib/python3.7/dist-packages/django/core/handlers/base.py", line 181, in _get_response
2021-07-09T15:12:30.451 INFO [gunicorn] response = wrapped_callback(request, *callback_args, **callback_kwargs)
2021-07-09T15:12:30.451 INFO [gunicorn] File "/app/myauth/views.py", line 233, in refresh
2021-07-09T15:12:30.451 INFO [gunicorn] set_token_cookies(response, res)
2021-07-09T15:12:30.451 INFO [gunicorn] File "/app/myauth/views.py", line 120, in set_token_cookies
2021-07-09T15:12:30.451 INFO [gunicorn] token_type: str = token_response["token_type"]
2021-07-09T15:12:30.451 INFO [gunicorn] KeyError: 'token_type'