diff options
author | 2020-12-31 18:08:08 +0800 | |
---|---|---|
committer | 2020-12-31 18:08:08 +0800 | |
commit | 154a0b19478e6c27fda9e8014931f6b0b1e7c7b3 (patch) | |
tree | dc85769b19646175d7ac607349b6dd76589d3e8a /backend/routes/auth/authorize.py | |
parent | Minor DevOps tweaks (diff) |
`jwt.encode` returns a string, not a bytestring.
As of pyjwt 2.0.0, `jwt.encode` does not return a bytestring, so
decoding is unnecessary.
ref: https://github.com/jpadilla/pyjwt/blob/c96131b970fd341106ce33d0a85b50e3bdbb67ec/CHANGELOG.md#jwtencode-return-type
Diffstat (limited to 'backend/routes/auth/authorize.py')
-rw-r--r-- | backend/routes/auth/authorize.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/backend/routes/auth/authorize.py b/backend/routes/auth/authorize.py index 2509109..975936a 100644 --- a/backend/routes/auth/authorize.py +++ b/backend/routes/auth/authorize.py @@ -55,6 +55,4 @@ class AuthorizeRoute(Route): token = jwt.encode(user_details, SECRET_KEY, algorithm="HS256") - return JSONResponse({ - "token": token.decode() - }) + return JSONResponse({"token": token}) |