django-allauth icon indicating copy to clipboard operation
django-allauth copied to clipboard

feat(accounts): add key to password reset template

Open c-w opened this issue 3 years ago • 2 comments

Currently, the password reset email template gets passed the full URL to the password reset endpoint. However, in some scenarios, this endpoint isn't the location where the user will actually perform the password reset data entry, for example if Django only hosts an API backend and the user-facing part instead is implemented via a SPA.

To make it easier to integrate such setups with allauth, this change additionally passes the uid and key to the password reset email template. This provides full control to the template author to generate their own password reset links and support a split frontend/backend.

c-w avatar Jun 03 '22 01:06 c-w

Note the similar use-case in https://github.com/pennersr/django-allauth/pull/3081; I believe the implementation provided here is more generic as the path variable can now be reconstructed in the template via reverse FYI @jhhayashi

c-w avatar Jun 03 '22 01:06 c-w

Makes sense to me. I'll close my PR in favor of this one

jhhayashi avatar Jun 03 '22 01:06 jhhayashi

Coverage Status

Coverage: 91.689% (+0.4%) from 91.338% when pulling b45d5b3eddffa14ed2605fdb32b0fea1e1c825ec on c-w:reset-password-uid-key into 11110780cd6338fb18e36b2485b3643f3ea1e3a3 on pennersr:master.

coveralls avatar Jan 16 '23 13:01 coveralls

@pennersr Any chance we could get this PR reviewed? Thanks in advance!

c-w avatar Mar 20 '23 11:03 c-w

TYSM for the merge!

c-w avatar Mar 30 '23 12:03 c-w