Skip to content

E-mail confirmations sent twice (duplicate emails) #677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
develop-test1 opened this issue Jul 12, 2016 · 5 comments
Closed

E-mail confirmations sent twice (duplicate emails) #677

develop-test1 opened this issue Jul 12, 2016 · 5 comments

Comments

@develop-test1
Copy link
Contributor

develop-test1 commented Jul 12, 2016

Gem version: 0.1.38 (as well as from master branch latest)

Rails version: 5.0.0 API

This version resolves #500, however it introduces error where same confirmation e-mail is sent twice, once the auth POST register action is performed resulting in duplicate e-mail sending.

MailCatcher screenshot:
screenshot from 2016-07-12 12 10 13

It is also worth noting that this only happens for confirmation e-mails. Password reset e-mails are sent once as expected.

@develop-test1
Copy link
Contributor Author

I found out that removing these lines in registrations_controller fixes the problem and confirmation e-mails are sent once:

  unless @resource.confirmed?
              # user will require email authentication
              # @resource.send_confirmation_instructions({
              #   client_config: params[:config_name],
              #   redirect_url: @redirect_url
              # })

            else

develop-test1 added a commit to develop-test1/devise_token_auth that referenced this issue Jul 14, 2016
@develop-test1
Copy link
Contributor Author

Opened-up pull request: #678

develop-test1 added a commit to develop-test1/devise_token_auth that referenced this issue Jul 14, 2016
@develop-test1
Copy link
Contributor Author

Other way to fix this problem is to include this in the user model:

  before_create :skip_duplicate_devise_confirmation_email

# Fixes problem with duplicate account confirmation emails
  def skip_duplicate_devise_confirmation_email
    skip_confirmation_notification!
  end

@brunowego
Copy link

@develop-test1 your solution works for me.

@MaicolBen
Copy link
Collaborator

#678 got it fixed, closing

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

No branches or pull requests

3 participants