Skip to content

Commit

Permalink
Update redirect conditional for both dashboard paths (#665)
Browse files Browse the repository at this point in the history
  • Loading branch information
mononoken authored Apr 24, 2024
1 parent e12e43c commit bad8079
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/controllers/concerns/organization_scopable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@ def set_tenant

def after_sign_in_path_for(resource_or_scope)
if allowed_to?(
:index?, Pet, namespace: Organizations,
:index?, with: Organizations::DashboardPolicy,
context: {organization: Current.organization}
)
dashboard_index_path
elsif allowed_to?(
:index?, with: Organizations::AdopterFosterDashboardPolicy,
context: {organization: Current.organization}
)
adopter_foster_dashboard_index_path
else
adoptable_pets_path
end
Expand Down

0 comments on commit bad8079

Please sign in to comment.