Skip to content

Commit

Permalink
Merge pull request #1315 from concord-consortium/166155743-fix-login-…
Browse files Browse the repository at this point in the history
…redirect

fix: Users always redirected to learner report path on report server [PT-166155743]
  • Loading branch information
dougmartin authored Jun 11, 2024
2 parents dfad955 + 0d55e73 commit 388b9eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 1 addition & 4 deletions rails/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ def check_student_consent
def after_sign_in_path_for(resource)
redirect_path = view_context.current_user_home_path

if BoolENV['RESEARCHER_REPORT_ONLY']
# force all users to try to go to the researcher page on a report only portal
redirect_path = learner_report_path
elsif params[:after_sign_in_path].present?
if params[:after_sign_in_path].present?
# the check for to see if the user has permission to view the after_sigin_in_path
# page is handled by the controller of this new page.
# if the user doesn't have permission to see the new page they will be sent to their
Expand Down
2 changes: 2 additions & 0 deletions rails/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ def current_user_home_path
if current_user.nil?
# anonymous home is the '/'
root_path
elsif BoolENV['RESEARCHER_REPORT_ONLY']
learner_report_path
elsif current_user.portal_student
my_classes_path
elsif APP_CONFIG[:recent_activity_on_login] && current_user.portal_teacher
Expand Down

0 comments on commit 388b9eb

Please sign in to comment.