From the genesys web site
const client = platformClient.ApiClient.instance;
client.loginImplicitGrant(clientId, redirectUri, { state: state })
.then((data) => {
console.log(data);
// Do authenticated things
})
.catch((err) => {
// Handle failure response
console.log(err);
});
From a console trace (with appropriate console.log statements) the "then/catch" is not run the first time. The first time this executes it causes a redirect (if successful) back to this page (assuming redirect=calling page). The web pages re-loads and runs a second time. It then runs the above statement a second time and this time because the user is authenticated(?), the "then" runs and returns a token and it sets this in "client".
Am I understanding this right?
Thanks