iMerica / dj-rest-auth

Authentication for Django Rest Framework
https://dj-rest-auth.readthedocs.io/en/latest/index.html
MIT License
1.67k stars 311 forks source link

✨ Allow easy overriding of PasswordResetConfirmSerializer user model lookup field #451

Closed nefrob closed 1 year ago

nefrob commented 1 year ago

When resetting a password from an email link we may want the lookup field on the user to be something other than the primary key (ex. unique email address). To support easy overriding of the lookup field it is now set as an instance variable on the serializer class.

nefrob commented 1 year ago

Alternatively I would suggest using UserModel.USERNAME_FIELD here.

iMerica commented 1 year ago

Thanks for the PR. but the API already exposes PASSWORD_RESET_CONFIRM_SERIALIZER where folks can customize as they wish. I would prefer to support a custom serializer rather than making the default serializer customizable.