Error when authenticating with the Widget

Just doing a simple login to my application using the widget:

var orgUrl = 'https://dev-XXXXXX.oktapreview.com';
var oktaSignIn = new OktaSignIn({baseUrl: orgUrl});

var renderWidget = function(){
  oktaSignIn.renderEl(
    {
      el: '#widget'
    },
    function (res) {
      if (res.status === 'SUCCESS') {
        console.log(res.session.token)
        res.session.setCookieAndRedirect('https://myapp.com');
      }
    }
  );
}

window.onload = renderWidget;

Everything works, I’m seeing an error before the redirect though:

Uncaught TypeError: Cannot read property 'charAt' of undefined
    at a.getDisplayName (<anonymous>:65:2244)
    at Okta.PageMonitor.<anonymous> (<anonymous>:3:24319)
    at h (<anonymous>:64:28513)
    at Okta.PageMonitor.trigger (<anonymous>:64:27864)
    at Okta.PageMonitor.<anonymous> (<anonymous>:71:31028)
    at h (<anonymous>:64:28457)
    at Okta.Form.trigger (<anonymous>:64:27864)
    at Okta.Form._triggerSubmit (<anonymous>:71:29979)
    at HTMLInputElement.dispatch (<anonymous>:27:3865)
    at HTMLInputElement.q.handle (<anonymous>:27:565)

Any thoughts?

This is a known issue when using the Sign-In Widget and the Okta Chrome Extension. Any application that you’re running on localhost will current throw the following error:

Uncaught TypeError: Cannot read property 'charAt' of undefined

FYI: issue has been fixed in release 2017.22 which will hit preview and product in following couple of weeks.

1 Like