Protecting content
Last updated
Was this helpful?
Was this helpful?
tiun.on('userChange', (data) => {
const { isAuthenticated, user } = data;
if (!isAuthenticated || !user) {
showPublicExperience();
return;
}
const hasPremium = user.productAccess.includes('YOUR_PRODUCT_ID');
if (hasPremium) {
showPremiumContent();
} else {
showUpgradePrompt();
}
});