fix: Re-instate hasEmailBeenChanged before sending email (#14596)

This commit is contained in:
Alex van Andel
2024-04-15 22:09:06 +00:00
committed by GitHub
parent 68ffd2248b
commit a788e07be1
@@ -353,7 +353,7 @@ export const updateProfileHandler = async ({ ctx, input }: UpdateProfileOptions)
});
}
if (updatedUser) {
if (updatedUser && hasEmailBeenChanged) {
// Skip sending verification email when user tries to change his primary email to a verified secondary email
if (secondaryEmail?.emailVerified) {
secondaryEmails.push({