Chatwoot/app/views/devise/mailer/confirmation_instructions.html.erb
Aswin Dev P.S 5ee209c079
chore: Fix user email re-confirmation flow (#3581)
Users can change their email from profile settings. They will be logged out immediately. Users can log in again with the updated email without verifying the same. This is a security problem.

So this change enforce the user to reconfirm the email after changing it. Users can log in with the updated email only after the confirmation.

Fixes: https://huntr.dev/bounties/7afd04b4-232e-4907-8a3c-acf8bd4b5b22/
2021-12-16 19:32:49 +05:30

14 lines
No EOL
718 B
Text

<p>Welcome, <%= @resource.name %>!</p>
<% account_user = @resource&.account_users&.first %>
<% if account_user&.inviter.present? && @resource.unconfirmed_email.blank? %>
<p><%= account_user.inviter.name %>, with <%= account_user.account.name %>, has invited you to try out Chatwoot! </p>
<% end %>
<p>You can confirm your account email through the link below:</p>
<% if account_user&.inviter.present? && @resource.unconfirmed_email.blank? %>
<p><%= link_to 'Confirm my account', frontend_url('auth/password/edit', reset_password_token: @resource.send(:set_reset_password_token)) %></p>
<% else %>
<p><%= link_to 'Confirm my account', frontend_url('auth/confirmation', confirmation_token: @token) %></p>
<% end %>