Skip to content

Commit

Permalink
Fix timestamp generation (#6)
Browse files Browse the repository at this point in the history
The generation of a timestamp using strftim('%s') does work on all platforms. This fixes that
  • Loading branch information
melkisedek authored and howardderekl committed Mar 22, 2019
1 parent e9dfc57 commit 07a202b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conduit/apps/authentication/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def _generate_jwt_token(self):

token = jwt.encode({
'id': self.pk,
'exp': int(dt.strftime('%s'))
'exp': int(dt.timestamp())
}, settings.SECRET_KEY, algorithm='HS256')

return token.decode('utf-8')
return token.decode('utf-8')

0 comments on commit 07a202b

Please sign in to comment.