Hi everyone, I’m using Firebase to handle user authentication and I’d like to navigate back to the home page when the user is not logged in. What is the best way to do that?
Here’s what I have so far:
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
$('#loginstatuspixel').trigger('login');
dmx.app.set('firebaseUser', user);
} else {
$('#loginstatuspixel').trigger('logout');
dmx.app.set('firebaseUser', null);
}
});
On my page I have an element called loginstatuspixel
that is listening to the logout event but I’m not sure what to do from here. I tried creating a logout
flow but couldn’t see an option to navigate pages.
<div class="d-block" id="loginstatuspixel" dmx-on:logout="logout.run()"></div>
Community Page
Last updated:
Last updated: