The above example did not work for me, using several areas in Devise.
I had to add the domain / resource name in the sign_in path for it to work, and also to prevent chaos, I also had to write out the old user, otherwise all kinds of confusion will abound.
The changes I had to make look something like this using the example above.
def update if current_account.update_with_password(params[:account]) sign_out(current_account) sign_in(:account, current_account, :bypass => true) flash[:notice] = 'Password updated.' redirect_to account_path else render :action => :show end end
Edit to add: I believe that I had to force a user to write out, because somewhere I tried the development code so that users do not exit during certain actions. Backdating; not a good idea! This approach is much better! It may be safer to create your own controllers or cancel the development code if this is not absolutely inevitable.
Jason H Jul 21 2018-12-12T00: 00Z
source share