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

_default_jwt_payload_handler: Check for attribute 'id' #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

_default_jwt_payload_handler: Check for attribute 'id' #126

wants to merge 2 commits into from

Conversation

AbdealiLoKo
Copy link

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

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.

None yet

2 participants