diff --git a/lms/templates/courseware/course_about.html b/lms/templates/courseware/course_about.html index 47c7f29755..9a80e4feb4 100644 --- a/lms/templates/courseware/course_about.html +++ b/lms/templates/courseware/course_about.html @@ -41,9 +41,8 @@ from six import string_types location.href = xhr.responseText; } } else if (xhr.status == 403) { - $('#register_error').text( - (xhr.responseText ? xhr.responseText : "${_("An error has occurred. Please ensure that you are logged in to enroll.") | n, js_escaped_string}") - ).css("display", "block"); + // redirect unauthenticated user to the login page + location.replace("${reverse('signin_user') | n, js_escaped_string}?next=" + encodeURIComponent("${request.path | n, js_escaped_string}")); } else { $('#register_error').text( (xhr.responseText ? xhr.responseText : "${_("An error occurred. Please try again later.") | n, js_escaped_string}")