123456789101112131415161718 |
- from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
- def verify_auth_token(token):
- s = Serializer('hard to guess string')
- try:
- data = s.loads(token)
- except:
- return None
- return data
- def test():
- print(verify_auth_token(
- 'eyJhbGciOiJIUzI1NiIsImlhdCI6MTUzNzg0Njc4MywiZXhwIjoxNTM5MDU2MzgzfQ.eyJpZCI6MzI0NTEzNH0.RqRoad8H5oAGY6L3qMLcxCUYE5Fl7-MXtpSyfSU4aqU'))
- test()
|