From b76ac19427a8beaf8f93d0507739d2ff49c79e3b Mon Sep 17 00:00:00 2001 From: "Abram (^o^)" Date: Tue, 8 Mar 2022 10:41:14 +0100 Subject: [PATCH] Fixed TypeError In the example above [https://github.com/jpadilla/pyjwt/edit/master/docs/usage.rst#encoding--decoding-tokens-with-hs256], when tried, it throws a TypeError that says: `encode() got an unexpected keyword argument 'algorithms'`, so I changed the `algorithms` to `algorithm` --- docs/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.rst b/docs/usage.rst index 9d541d56..91d96791 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -8,7 +8,7 @@ Encoding & Decoding Tokens with HS256 >>> import jwt >>> key = "secret" - >>> encoded = jwt.encode({"some": "payload"}, key, algorithms="HS256") + >>> encoded = jwt.encode({"some": "payload"}, key, algorithm="HS256") >>> print(encoded) eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg >>> jwt.decode(encoded, key, algorithms="HS256")