django-rest-auth
django-rest-auth copied to clipboard
Fix errors when authenticated user has no associated email address
There are two cases where this can happen currently:
- User was added without using the register API (e.g. in django admin)
- Custom AuthenticationBackend is used returning a user different than AUTH_USER_MODEL
In both cases the current result would be a 500 response.
The fix returns a 400 with E-mail is not verified.
.
Coverage increased (+0.07%) to 97.143% when pulling 1fc84ce03ed571161f779499b65a74d50beae377 on rubengrill:login-serializer into 3b80fcbca9b3d9f9f918cda27db86ee0869556cd on Tivix:master.
@rubengrill Can you please resolve the conflicts? I'll merge this PR right afterwards. Thank you for providing unit tests as well! 👏
Hi, as a user of rest-auth, thanks for the contribution! This repo is not maintained anymore, so the development moved to dj-rest-auth. (reference: https://github.com/Tivix/django-rest-auth/issues/568) It may be best, if you move this PR there. (and upgrade to using dj_rest_auth)
new repo link: https://github.com/jazzband/dj-rest-auth (I'm not the upkeeper of that repo, it just makes sense for me to help you merge your PR)
Many Thanks, Barney