Skip to content

Commit e94f213

Browse files
committed
Redirect to first organization
1 parent 1be6c02 commit e94f213

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/controllers/home_controller.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
class HomeController < ApplicationController
2+
3+
# TODO: what happens when the user doesn't pertain to any organization?
24
def index
3-
redirect_to :users if current_user
5+
return unless current_user
6+
7+
organization_id = current_user.organization_ids.first
8+
9+
redirect_to organization_path(id: organization_id)
410
end
511
end

0 commit comments

Comments
 (0)