nrbnlulu / strawberry-django-auth

Authentication system for django using strawberry
https://nrbnlulu.github.io/strawberry-django-auth/
MIT License
68 stars 30 forks source link

Allow overriding of UserType class #472

Open ali-hnaineh opened 8 months ago

ali-hnaineh commented 8 months ago

I have a case where i need to get more data on the login, I tried UPDATE_MUTATION_FIELDS, to inject fields, but it seems only working with actual model fieds and not properties, i want to add a resolver,

why not to add another setting to point at an another "UserType" class, defined by us, twhile skipping the hassle of overriding all the other auth schema or update such that UPDATE_MUTATION_FIELDS works with non model fields

nrbnlulu commented 8 months ago

Hey, that's a good Idea I actually thought about this but this might be hard to implement due to django's app imports.

I currently don't have time to work on this though this is certainly something I want to implement.

ali-hnaineh commented 8 months ago

smth like GqlAuthSettings( .... USER_TYPE: "appname.filename.classname" ) as a string then import it sometime after i've seen this done in other packages (not saying that these were used in a similar context)