Skip to content

Commit

Permalink
fix: prevent redirects to /undefined after saml auth
Browse files Browse the repository at this point in the history
When a user authenticates using SAML, but their accounts
aren't linked, they land on the login page with the
message to link their accounts. If the
OC_REDIRECT_ON_TPA_UNLINKED_ACCOUNT value is not setup,
they end up getting redirected to /undefined. This commit
validates the redirectURL as a valid string before
performing the redirect.

Internal-ref: https://tasks.opencraft.com/browse/BB-9010
  • Loading branch information
tecoholic committed Aug 9, 2024
1 parent 2e2ec0a commit d9d761a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lms/static/js/student_account/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@
this.clearFormErrors();
this.renderThirdPartyAuthWarning();
}
window.location.href = redirectURL;
if (typeof redirectURL === "string" && redirectURL.length) {
window.location.href = redirectURL;
}
} else {
this.renderErrors(this.defaultFormErrorsTitle, this.errors);
}
Expand Down

0 comments on commit d9d761a

Please sign in to comment.