Skip to content

Commit

Permalink
fixed jwt driver
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Jan 12, 2021
1 parent 2380294 commit 9429b49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/masonite/drivers/authentication/AuthJwtDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def save(self, _, **kwargs):
serialized_dictionary = model.serialize()
serialized_dictionary.update({"expired": cookie_expire_time("5 minutes")})
token = self.jwt.encode(serialized_dictionary, KEY, algorithm="HS256")
token = bytes(token).decode("utf-8")
if isinstance(token, bytes):
token = bytes(token).decode("utf-8")
self.request.cookie("token", token)

def delete(self):
Expand Down

0 comments on commit 9429b49

Please sign in to comment.