Skip to content

Instantly share code, notes, and snippets.

@wyattjoh
Created September 26, 2018 19:04
Show Gist options
  • Save wyattjoh/be3924a621de0a127ded0c9a5fbafbf7 to your computer and use it in GitHub Desktop.
Save wyattjoh/be3924a621de0a127ded0c9a5fbafbf7 to your computer and use it in GitHub Desktop.
Example for listening for the `action.SHOW_SIGNIN_DIALOG` event to trigger a client side redirect to an external auth source.
<div id='coralStreamEmbed'></div>
<script src="https://url.for.talk.com/static/embed.js"></script>
<script>
function attachToEvents(events) {
events.on('action.SHOW_SIGNIN_DIALOG', function() {
window.href = "https://url.for.logging.user.in.com/";
});
}
Coral.Talk.render(document.getElementById('coralStreamEmbed'), {
talk: 'https://url.for.talk.com/',
events: attachToEvents,
auth_token: 'maybe your user\'s auth token?',
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment