{% requireLogin %} not working on extended (layout template) files? Is there a reason {% requireLogin %} is not firing when using in a parent include?
if I place {% requireLogin %} inside the main template file and then use this like so:
homework.twig
{% extends &quot;_layouts/members-page-layout.twig&quot; %}
It is not firing? But if I put it inside the homework.twig file directly it fires....
Was hoping t avoid having to add it to multiple templates and just add it to a 'members' parent layout template.
EDIT 18 July 2020
Editing the post to include more information
Here is the parent template I am trying to include the {% requireLogin %} that is not firing.
{# -- Layout template for HTML pages -- #}
{% extends &quot;_boilerplate/_layouts/base-html-layout.twig&quot; %}

{# -- Any &lt;meta&gt; tags that should be included in the &lt;head&gt; #}
{% block headMeta %}
{% endblock headMeta %}

{# -- Any &lt;link&gt; tags that should be included in the &lt;head&gt; #}
{% block headLinks %}
{% endblock headLinks %}

{# -- Any CSS that should be included before &lt;/head&gt; -- #}
{% block headCss %}
  {# Google fonts #}
  &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt;
  
  {% include &quot;_inline-css/site-fonts.css&quot; %}
{% endblock headCss %}

{% requireLogin %}

{# -- Page body -- #}
{% block bodyHtml %}
  {% set primarySectionColor      = 'navy' %}
  {% set secondarySectionColor    = 'pink' %}
  
  {% if currentUser.admin %}
    {#    TODO: Make this hide#}
    &lt;div class=&quot;max-w-2xl fixed bottom-0 left-0 border border-green-400 m-2&quot;&gt;
      &lt;div class=&quot;flex&quot;&gt;
        &lt;div class=&quot;bg-green-100 p-3 text-green-500 text-sm flex&quot;&gt;
          {{ svg('@icons/bx/bx-info-circle.svg', class=&quot;w-5 h-5 flex-shrink-0 fill-current mr-1&quot;) }}
          You are currently logged in as an admin role so you have unrestricted access and therefore you will not see the filtering of content and homework like a member user
          (parent) would see.
        &lt;/div&gt;
        &lt;button class=&quot;bg-green-500 text-white p-2&quot;&gt;
          {{ svg('@icons/bx/bx-info-circle.svg', class=&quot;w-8 h-8 flex-shrink-0 fill-current&quot;) }}
        &lt;/button&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  {% endif %}
  
  &lt;div id=&quot;page-container&quot;&gt;
    {# -- Info header, including _navbar.twig -- #}
    {% include &quot;_globals/header.twig&quot; %}
    
    {# - IE notice for Old browsers - #}
    {% include '_globals/ie-notice.twig' %}
    
    &lt;main&gt;
      {# -- Primary content block -- #}
      {% block content %}
      {% endblock %}
    &lt;/main&gt;
    
    {# -- Content that appears below the primary content block -- #}
    {% block subcontent %}
    {% endblock %}
    
    {# -- Info footer -- #}
    {% include &quot;_globals/footer.twig&quot; %}
  
  &lt;/div&gt;
{% endblock bodyHtml %}
Try inside this in the main template file:
{% block access %}  
    {% requireLogin %}
{% endblock %}