Skip to content

onAuthFail and onAuthorizeSuccess not firing #997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
isaacpresidium opened this issue Apr 9, 2025 · 0 comments
Open

onAuthFail and onAuthorizeSuccess not firing #997

isaacpresidium opened this issue Apr 9, 2025 · 0 comments

Comments

@isaacpresidium
Copy link

I have this typescript function that is called when I click a button to initialize ccp. For some reason onInitialized works fine and the callback is called, but this isn't the case for onAuthFail or onAuthorizeSuccess. Please help, I'm using react if that helps.

function initCCP() {
    if (!containerDiv.current || !window.connect) return
    window.open(instanceURL, connect.MasterTopics.LOGIN_POPUP, "width=400,height=600")

    connect.core.initCCP(containerDiv.current, {
      ccpUrl: instanceURL, // REQUIRED
      loginPopup: false, // optional, defaults to `true`
      loginPopupAutoClose: true, // optional, defaults to `false`
      loginOptions: {
        // optional, if provided opens login in new window
        autoClose: true, // optional, defaults to `false`
        height: 600, // optional, defaults to 578
        width: 400, // optional, defaults to 433
        top: 0, // optional, defaults to 0
        left: 0 // optional, defaults to 0
      },
      region: "us-west-2", // REQUIRED for `CHAT`, optional otherwise
      softphone: {
        // optional, defaults below apply if not provided
        allowFramedSoftphone: true, // optional, defaults to false
        disableRingtone: false, // optional, defaults to false
      },
      pageOptions: {
        //optional
        enableAudioDeviceSettings: false, //optional, defaults to 'false'
        enablePhoneTypeSettings: true //optional, defaults to 'true'
      },
    });
    connect.core.onInitialized(() => {
      setInitialized(true)
      console.log("✅ Amazon Connect Streams Initialized");
    });
    connect.core.onAuthFail(() => {
      console.log('❌ not logged in!')
    });
    connect.core.onAuthorizeSuccess(() => {
      console.log('✅ logged in!')
    });
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant