How to show a file download link in my website if the visitor is logged in with Firebase authentication?
I can use the JavaScript if (user)
for checking if the user is signed in. But if I use
if (user){
document.getElementById('download_link').style="display:block;}else{document.getElementById('download_link').style="display:none;}
, The visitors can simply get the the download link without signing in by getting webpage source code.
I've integrated firebase authentication and in every of my web pages, I want the download link to be only shown if the visitor is a logged user.
If I use simple css display:none
with JavaScript if(user), then visitors can simply get the link by entering view-source: {site_url}
is the browser address bar.
Please help