Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
temp: Add configuration option to redirect to external site when TAP …
…account is unlinked

(cherry picked from commit e83a8c8f82849644cf95534cde3fe149e4f11916)
(cherry picked from commit 0c831dc)
(cherry picked from commit c596bf3)
(cherry picked from commit 64f5dea)
(cherry picked from commit 7b12b00)
(cherry picked from commit 4fe3892)
(cherry picked from commit edf77a0)
  • Loading branch information
xitij2000 committed Aug 11, 2026
commit 9fab2fdc5dfff30cb1071a7da958763a91042f44
3 changes: 3 additions & 0 deletions lms/static/js/student_account/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@
saveError: function(error) {
var errorCode;
var msg;
var redirectURL;
if (error.status === 0) {
msg = gettext('An error has occurred. Check your Internet connection and try again.');
} else if (error.status === 500) {
Expand Down Expand Up @@ -245,6 +246,7 @@
} else if (error.responseJSON !== undefined) {
msg = error.responseJSON.value;
errorCode = error.responseJSON.error_code;
redirectURL = error.responseJSON.redirect_url;
} else {
msg = gettext('An unexpected error has occurred.');
}
Expand All @@ -266,6 +268,7 @@
this.clearFormErrors();
this.renderThirdPartyAuthWarning();
}
window.location.href = redirectURL;
} else {
this.renderErrors(this.defaultFormErrorsTitle, this.errors);
}
Expand Down
10 changes: 8 additions & 2 deletions openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _do_third_party_auth(request):

try:
return pipeline.get_authenticated_user(requested_provider, username, third_party_uid)
except USER_MODEL.DoesNotExist:
except USER_MODEL.DoesNotExist as err:
AUDIT_LOG.info(
"Login failed - user with username {username} has no social auth " # noqa: UP032
"with backend_name {backend_name}".format(username=username, backend_name=backend_name)
Expand All @@ -101,7 +101,13 @@ def _do_third_party_auth(request):
register_label_strong=HTML("<strong>{register_text}</strong>").format(register_text=_("Register")),
)

raise AuthFailedError(message, error_code="third-party-auth-with-no-linked-account") # lint-amnesty, pylint: disable=raise-missing-from # noqa: B904
redirect_url = configuration_helpers.get_value('OC_REDIRECT_ON_TPA_UNLINKED_ACCOUNT', None)

raise AuthFailedError(
message,
error_code='third-party-auth-with-no-linked-account',
redirect_url=redirect_url
) from err


def _get_user_by_email(email):
Expand Down