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

bugfix for dict based identity #63

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

Conversation

pall-valmundsson
Copy link

When using a dict object to represent an identity the default jwt_encode_callback handler fails as getattr does not work with dict objects. This change sets the default value of getattr to None so the dict get part of the statement is evaluated.

The tests required a different implementation of the app fixture.

When using a dict object to represent an identity the default
jwt_encode_callback handler fails as getattr does not work with dict
objects. This change sets the default value of getattr to None so the
dict get part of the statement is evaluated.
@garykrige
Copy link

Please merge this 👍

@davidrpmorris
Copy link

👍

@ntamas
Copy link

ntamas commented Mar 13, 2016

👍 (same as my pull request #79 - I did not notice this one).

@aguegu
Copy link

aguegu commented Mar 30, 2016

I have run into the same error when retrieving identity from RethinkDB, which return in dict.

I would create my own PR if I did not find this PR.

by the way, how about make it this way

identity = getattr(identity, 'id', None) or identity.get('id', None)

feel more robust

Wish it being merged soon.

@eLvErDe
Copy link

eLvErDe commented Jun 6, 2016

Hello,

I just ran into the same issue, please merge :)

Regards, Adam.

@garykrige
Copy link

@mattupstate this is a fairly urgent and easy bug to fix

@setyongr
Copy link

@mattupstate this issue still not fixed, please merge

@stephane
Copy link

stephane commented Aug 3, 2016

I don't intend to maintain the fork but in the meantime, I merged several nice PRs and fixes into https://github.com/webstack/flask-jwt/commits/fork

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.

8 participants