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}