Skip to content

Commit 9aee2fd

Browse files
committed
Adding a custom version of user_root_path to override where a user goes after authN via Devise
1 parent da12f38 commit 9aee2fd

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app/controllers/application_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,10 @@ def set_locale
5050
def constrained_locale
5151
return params[:locale] if params[:locale].in? Object.new.extend(HyraxHelper).available_translations
5252
end
53+
54+
# Devise uses this method to tell where to send the user to after signing in.
55+
# Conditionally set to either the dashboard or root_path based on site_usage.
56+
def user_root_path
57+
helpers.access_only? ? root_path : hyrax.dashboard_path
58+
end
5359
end

0 commit comments

Comments
 (0)