From 65c4950db9a8e4e4313dee46601a04690f0aa9c8 Mon Sep 17 00:00:00 2001 From: Jesus Urueta Date: Tue, 11 May 2021 20:13:01 -0500 Subject: [PATCH] change in assing data id --- flask_jwt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_jwt/__init__.py b/flask_jwt/__init__.py index f864b78..710ef4d 100644 --- a/flask_jwt/__init__.py +++ b/flask_jwt/__init__.py @@ -50,7 +50,7 @@ def _default_jwt_payload_handler(identity): iat = datetime.utcnow() exp = iat + current_app.config.get('JWT_EXPIRATION_DELTA') nbf = iat + current_app.config.get('JWT_NOT_BEFORE_DELTA') - identity = getattr(identity, 'id') or identity['id'] + identity = identity['id'] if (type(identity) is dict) else getattr(identity, 'id') return {'exp': exp, 'iat': iat, 'nbf': nbf, 'identity': identity}