Anatoly - Hi team!I'm using <AppEmbed /> and I...
Hi team!
I'm using <AppEmbed /> and I have a question regarding 'init()' process and embed events.
I'm considering a case where there's a long delay between the 'Init' and 'AuthInit' events without any further outcome, and the 'AuthExpire' or 'Error' events don't trigger. Additionally, the subscriptions 'authStatus.on(AuthStatus.SUCCESS)' and 'authStatus.on(AuthStatus.FAILURE)' aren't firing either.
Is there a way to handle this by setting a timeout - for example, to close the session and show an error if nothing happens in a certain time?
Or maybe there's another recommended approach to handle such a situation?
6 Replies
How are you using these events? cc @Aditya
At the moment, I’m following what’s described in the documentation:
I initialize using
const authStatus = init({...});
Then I subscribe to:
authStatus.on(AuthStatus.SUCCESS, () => {...});
authStatus.on(AuthStatus.FAILURE, (reason) => {...});
After <AppEmbed />
renders, I typically observe either a SUCCESS
or FAILURE
event.
However, I encountered a case where, after initializing and rendering <AppEmbed />
, it got stuck - and I didn’t receive either a success or failure status.
That made me wonder: how can I handle or prevent this kind of situation in the future?
As of now, I’m not using the built-in embedEvents like 'Init' or 'AuthInit' for anything other than debug logging.Hey @Anatoly what authentication method are you using?
I'm using the 'AuthType.TrustedAuthTokenCookieless' method
@Justin Mathew can you check this as well?
@Anatoly ideally these events should be enough, but we do have another EmbedEvent called Embed.Error
but this is also triggered on cases where the Error is internally handled / non breaking errors , but you can listen to this and take action based on the data that is sent along with this Event