Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

_default_jwt_payload_handler: Check for attribute 'id'#126

Open
AbdealiLoKo wants to merge 2 commits intopallets-eco:masterfrom
AbdealiLoKo:ajk-id
Open

_default_jwt_payload_handler: Check for attribute 'id'#126
AbdealiLoKo wants to merge 2 commits intopallets-eco:masterfrom
AbdealiLoKo:ajk-id

Conversation

@AbdealiLoKo
Copy link
Copy Markdown

If the attribute 'id' does not exist, do not use it.
Use the item 'id' instead.

Fixes #115

If the attribute 'id' does not exist, do not use it.
Use the item 'id' instead.

Fixes #115
if hasattr(identity, 'id'):
identity = getattr(identity, 'id')
else:
identity = identity['id']
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not identity = getattr(identity, 'id', None) or identity['id'] as suggested in #115 (comment) ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants