You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Devise requires current password in order to change account, but does not require current password for account deletion.
Expected behavior
Devise should require current password in order to delete account.
Manual solution
def destroy
if resource.destroy_with_password(params[:user][:current_password])
flash[:notice] = "Your account has been deleted"
redirect_to root_path
else
flash[:alert] = "Wrong password"
render :edit, layout: 'application'
end
end
cireficc, fakenine, Cponcax, collimarco and jonathanhefner