PedroBern / django-graphql-auth

Django registration and authentication with GraphQL.
https://django-graphql-auth.readthedocs.io/en/latest/
MIT License
329 stars 106 forks source link

Support django-graphql-jwt==0.3.1? Maybe resolve issue with info.context.user (permission) #44

Closed patrykKlimczak closed 4 years ago

patrykKlimczak commented 4 years ago

I try to get id with other model than user (or extend user model) I use

@login_required
    def resolve_posts_partner(self, info):
        print(info.context.user.id, 'my user partner id')
        return Post.objects.order_by('-updated_at').filter(partner_id=info.context.user.id)

and I have image

When i delete @login_required

I have image

problem with info.context.user.id

Maybe who help me?

ulgens commented 4 years ago

I tried to update this package last week and got lost in broken stuff. I can try again.

patrykKlimczak commented 4 years ago

@ulgens problem with info.context.user.id will be resolve with upgrade jwt package?

ulgens commented 4 years ago

I don't have that issue with current master django-graphql-auth and 0.3 version of jwt package. If info.context.user.idis None, it looks like authentication is failing. I'm not sure this is realated to the packages.

patrykKlimczak commented 4 years ago

@ulgens I wrote my case with this issue https://github.com/PedroBern/django-graphql-auth/issues/37#issuecomment-633001357

patrykKlimczak commented 4 years ago

@ulgens One load page with two query

image

Two different sessions with id :O when I check change log 0.3.1 JWT maybe :)

PedroBern commented 4 years ago

Hi @patrykKlimczak can you update your issue to use the issue template? When you have opened your issue it was already available. We need reproducible steps to help.

patrykKlimczak commented 4 years ago

@PedroBern Done https://github.com/PedroBern/django-graphql-auth/issues/46

You can probably close it

PedroBern commented 4 years ago

Closing in favor of #46