diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5981bdf..b77eabf 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -3,6 +3,13 @@ class ApplicationController < ActionController::Base before_filter :authenticate_user! + # Devise override - After login, if there is only one app, + # redirect to that app's path instead of the root path (apps#index). + def stored_location_for(resource) + location = super || root_path + (location == root_path && App.count == 1) ? app_path(App.first) : location + end + protected def require_admin! @@ -10,3 +17,4 @@ class ApplicationController < ActionController::Base end end + -- libgit2 0.21.2