GithubHelp home page GithubHelp logo

Comments (11)

davidjosephhayes avatar davidjosephhayes commented on June 14, 2024 8

I did this:

       const bus = connect.core.getEventBus();

        // get the agent init to set logged in
        bus.subscribe(connect.AgentEvents.INIT, this.handleAgentLogin);

        // handle shared worker terminated to set agent logged out
        bus.subscribe(connect.EventType.TERMINATED, this.handleAgentLogout);

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024 1

@k1p1l0 No, I haven't. Though instead of making a new thread I added a comment on my other login API thread. Still looking for login/logout callbacks.

from amazon-connect-streams.

chriys avatar chriys commented on June 14, 2024 1

@davidjosephhayes the log out solution is definitely working.
For those using ES5 or a script tag. This can help.
The following lines need to be after the ccp has been initiated initCCP()

// Get the event but
var eventBus = connect.core.getEventBus();

// Attach a handler to the login event
// connect.EventType.INIT is a constant containing the name of the event.
eventBus.subscribe(connect.EventType.INIT, function() {
  // whatever you need your code to do here.
  console.log('logged in');
});

// Attach a handler to the log out event
// connect.EventType.TERMINATED is a constant containing the name of the event.
eventBus.subscribe(connect.EventType.TERMINATED, function() {
  // whatever you need your code to do here.
  console.log('logged out');
});

from amazon-connect-streams.

k1p1l0 avatar k1p1l0 commented on June 14, 2024

Hey @sromocki! Did you find the answer?

from amazon-connect-streams.

naresh-talluri avatar naresh-talluri commented on June 14, 2024

@sromocki
Login ==> i would consider calling agent() from connect object would trigger after successful login, ex: connect.agent(callback);

Logout ==>
let bus = connect.core.getEventBus();
bus.subscribe(connect.EventType.AUTH_FAIL, () => {
//do something
}

hope this helps!

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

@naresh-talluri Yea, that's what I did for login. I haven't tried that logout solution though (just been living without being able to logout), I'll give it a shot.

from amazon-connect-streams.

saketag avatar saketag commented on June 14, 2024

Depending upon what you intend to solve here, the recently launched agent event stream may be handy - http://docs.aws.amazon.com/connect/latest/userguide/agent-event-streams.html

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

@saketag Just needed callbacks to be able to show in my application that the user is indeed logged in/out of connect and can/cannot place calls. I'm not sure how I'd do that with the agent event stream, looks like that's more for reporting.

from amazon-connect-streams.

sromocki avatar sromocki commented on June 14, 2024

@naresh-talluri I tried your logout strategy, but that AUTH_FAIL event does not appear to be triggered on logout. I also checked the TERMINATE and CLOSE events but those don't appear to trigger either.

from amazon-connect-streams.

pavanrachapudy avatar pavanrachapudy commented on June 14, 2024

When I authenticate with my amazon connect credentials on the other page and when i come to my web page, it is taking lot of time to trigger connect.agent(...). Is there something, I am missing. Any help on this would be appreciated.

from amazon-connect-streams.

camstuart avatar camstuart commented on June 14, 2024

On this note, is there a way to trigger a logout? (destroy the session)

For testing I have set up multiple accounts, but as you probably know, once a session is created, all browser tabs see the session. I would like to be able to logout, so I can log back in again as a different user

from amazon-connect-streams.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.