mcueto / djangorestframework-auth0

Library to simply use Auth0 token authentication in DRF within djangorestframework-jwt
MIT License
91 stars 19 forks source link

Use the optimized auth0 management api #25

Closed Calion54 closed 7 years ago

Calion54 commented 7 years ago

Hi,

It's me again !

I have a model which references the publication of someone. I would like return the name of the person who owns the publication. So, I using the auth0 management api in the ModelSerializer (thank to methodSerializerFIeld) and with the user_id I request /api/v2/users/{id} but if I have a list of 30 publication I get 30 request and it's too slow.

Do you have a better solution to use the api management in my api ? Or can it be the front to make the requests?

mcueto commented 7 years ago

I think that you can retrieve this data directly from the lockjs scope, save this data into a separated model in your API and update this every time the user who own the publication logs in. So, when you wanna get the people of the publication you can retrieve this easily without request any external data.

Nice week!

Calion54 commented 7 years ago

Hello,

Finally, I do a endpoint that saves me the username after the user creates his account as you told me Thank you.