0

Been looking around for a solution and couldn't find any. I am trying to skip sending of the confirmation email and send it after a user account's password has been set. However, after the password is set the confirmed_at is also set, so it gets confirmed before the email confirmation link is used. Below is my code. Thanks in advance

I am skipping confirmation with this (user.rb)

before_save :skip_confirmation

def skip_confirmation
 self.skip_confirmation!
end

Then when the user has set a password (user_controller.rb)

# Updating user password fields
               ....    
@user.send_confirmation_instructions if password_set
Pan Wangperawong
  • 1,250
  • 2
  • 13
  • 29

1 Answers1

0

Just for the record, this is because skip_confirmation! actually marks the account as confirmed (sets the confirmed_at column). To just skip sending the confirmation email, use skip_confirmation_notification! instead. It looks like you're using some customised code (user_controller.rb), as with the normal devise registration process the confirmation email wouldn't be sent until a user had been created, including a password.

Tim
  • 2,903
  • 2
  • 18
  • 16