djangoflow / django-df-auth

Opinionated Django REST auth endpoints for JWT authentication and social accounts
MIT License
10 stars 19 forks source link

Support username related authentication in a consistent way for openapi schemas #22

Closed adar2378 closed 11 months ago

adar2378 commented 1 year ago

We currently support authenticating via email only in the schema. I am aware of that we have some sort of settings in BE to use username and email, but if it changes from project to project then FE djangoflow_auth library can not work properly

Example:

class TokenObtainRequest {
  /// Returns a new [TokenObtainRequest] instance.
  TokenObtainRequest({

     this.email, // using username changes this field name to `username` which creates inconsistency 

     this.otp,

     this.password,
  });

Desired, username should be also supported with consistent schema methods and models.

It could be non-working endpoints as well if BE doesn't implement. But FE we would require consisntent naming of these methods and models.

Related to https://github.com/djangoflow/flutter-djangoflow/issues/46