I am attempting to customize our Okta hosted sign-in widget and seem to be running into trouble when adding the afterRender method. Using this method, I am attempting to adjust the HTML within the widget - which seems to work, but then I get the following error message when trying to login:
My code is pretty straight-forward, but the login portion always works when I comment this out so something is clearly funky with it
oktaSignIn.on('afterRender', function (context) {
console.log('context: ' + context);
if(context.controller == 'primary-auth')
{
var formDiv = document.querySelector("[data-se='o-form-content']");
formDiv.innerHTML += "<div id=\"tou-copy\">By signing into your J. J. Keller account, you agree to the <a target=\"_blank\" href=\"https://www.jjkeller.com/learn/terms-conditions\">Terms of Use</a>. For information about how we use any personal information we collect for our own purposes, please review our <a target=\"_blank\" href=\"https://www.jjkeller.com/learn/notice-at-collection\">Notice at Collection</a>.</div>";
var unlockLink = document.querySelector("[data-se='unlock']");
var helpLink = document.querySelector("[data-se='help']");
unlockLink.remove();
helpLink.remove();
}
});