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

Reimplment the library using backends #527

Open nrbnlulu opened 7 months ago

nrbnlulu commented 7 months ago

Backend would replace the settings object. we would have a default implementation for a django backend and in the future possibly other orm's.

The backed should look like this:


class GqlAuthUserProto:

    def get_pk_field():
        ... 
    # possibly other things

class GqlAuthBackend(Protocol):

    def get_user_type(self) ->  GqlAuthUserProto:
        ...

    def login(data: TBD ) -> GqlAuthUserProto:
        ...

    # TBD

This will allow users to extend this library how ever they would want without a pile of settings.

This issue should solve