Tivix / django-rest-auth

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
www.tivix.com
MIT License
2.4k stars 662 forks source link

Wrong response on using login without verifying the user #656

Closed vi4hu closed 2 years ago

vi4hu commented 2 years ago

Python version: 3.8.0 Django version: 3.2.4 Django-rest-auth version: 0.9.5

When a user tries to log in before verifying the Email, (s)he should get an Email is not verified. response. Right now, it says the password is wrong for the given user.

{
    "non_field_errors": [
        "Incorrect password for this user. You have 4 more attempts to login"
    ]
}

Urlpattern:

path('', include('rest_auth.urls')),

Could this be added as a feature?

vi4hu commented 2 years ago

There is a middleware that is changing the ValidationError response. Everything is fine with the django-rest-auth==0.9.5