Skip to content

Email change must be confirmed#91

Merged
nuest merged 15 commits intomainfrom
feature/email_change_confirmation
Mar 27, 2025
Merged

Email change must be confirmed#91
nuest merged 15 commits intomainfrom
feature/email_change_confirmation

Conversation

@uxairibrar
Copy link
Collaborator

@uxairibrar uxairibrar commented Feb 15, 2025

closes #24

  • Updated EmailChangeSerializer in serializers.py to validate and ensure uniqueness of the new email.
  • Implemented confirm_email_change function in views.py to handle email change confirmation securely using cache.
  • Modified URL patterns in urls.py to include a route for email confirmation.
  • Enhanced validation by checking token integrity, preventing expired links, and logging users in after confirmation.

Copy link
Member

@nuest nuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Please add a UI test and then this should be all done.

login(request, user, backend="django.contrib.auth.backends.ModelBackend")

return render(request,'changeuser.html')
messages.success(request, "Your email has been successfully updated!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, one more change here: Can you at the very end please also send one more message to the old email, so we also have a notification there: "Hi! Your email was changed from x to y, if that is incorrect please reach out to us at BASE_URL/contact.

@nuest
Copy link
Member

nuest commented Mar 19, 2025

@uxairibrar Unit tests are working again.

Copy link
Member

@nuest nuest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge this if @uxairibrar says it's complete - I think it is.

@nuest nuest merged commit dbb9914 into main Mar 27, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Email change must be confirmed

2 participants