Skip to content
Advertisement

How to use {% if user.is_authenticated %} in html to display or remove content

I’m trying to display certain content in my navbar when a user is logged in, but {% if user.is_authenticated %} does not work when I add it to my HTML

JavaScript

Advertisement

Answer

Flask-Login adds the current_user variable to your templates

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement