I am trying to understand how Jinja2 passes variables from my flask app with flask- login to a jinja2 template and how it interacts with the User class variable is_authenticated. Currently in my app this conditional statement seem to fully work as intented:
{% if current_user.is_authenticated %}
<h1>Hi {{ current_user.username }}!</h1>
{% endif %}
But if I try to be more explicit in my jinja2 statement for once, nothing seem to work out, among others that I have tried:
{% if current_user.is_authenticated is sameas true %}
{% if current_user.is_authenticated == "True" %}
{% if current_user.is_authenticated == true %}
{% if current_user.is_authenticated == "1" %}
...plus a whole battery of things that seem not to be working. When I print out the variable user.is_authenticated is is:
<bound method User.is_authenticated of <User 1>>
How can I explicitly check this one for being true? Why is jinja2 accepting {% if current_user.is_authenticated %} but not a more explicit statement like {% if current_user.is_authenticated == true %} ? What am I missing?