Reconfirmable - problem in validation

24 views
Skip to first unread message

Christiane Okamoto

unread,
Sep 29, 2016, 2:59:10 AM9/29/16
to Devise
When I register a new user, everything works fine.. The confirmation email is sent, and when he clicks on the link, is redirected to the root_path, already signed in.. But when he changes his email, the reconfirmation email is sent, but when he clicks on the link, I get the message that the password is blank.. But I am logged in the system already, I wanted to just confirm the user (and save the new email) skipping the password.. The method of my ConfirmationController:

def show
   
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
   
# resource.skip_pass_presence = true

   
if resource.errors.empty?
      set_flash_message
(:notice, :confirmed) if is_navigational_format?
      sign_in
(resource_name, resource) if !signed_in?
      respond_with_navigational
(resource){ redirect_to main_pages_path, :flash => { :notice => I18n.t('.devise.confirmations.confirmed')} }
   
else
      respond_with_navigational
(resource){ redirect_to root_path, :flash => {:error => resource.errors.full_messages.first }}
   
end
 
end


Is there any way to 
skip_pass_presence in this case?
Reply all
Reply to author
Forward
0 new messages