Skip to content

Commit e5cd019

Browse files
committed
Return to admin dashboard after resetting admin password
1 parent 8451427 commit e5cd019

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

app/controllers/alchemy/admin/passwords_controller.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ def admin_edit_password_url(_resource, options = {})
2727
end
2828

2929
def after_resetting_password_path_for(resource)
30-
if can? :index, :alchemy_admin_dashboard
31-
alchemy.admin_dashboard_path
32-
else
33-
alchemy.root_path
34-
end
30+
alchemy.admin_dashboard_path
3531
end
3632
end
3733
end

spec/features/admin/password_reset_feature_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
fill_in :user_password_confirmation, with: 'secret123'
3131
click_button 'Change password'
3232

33+
expect(page.current_path).to eq(alchemy.admin_dashboard_path)
34+
3335
expect(page)
3436
.to have_content('Your password has been changed successfully.')
3537
end

0 commit comments

Comments
 (0)