Use coop_url for auth links in shared templates

url_for('auth.account') and url_for('auth.newsletters') only work in
the blog app. Other apps (cart) that render these shared templates
don't have an auth blueprint. Use coop_url() so links always resolve
to the blog subdomain regardless of which app renders the template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-18 19:18:28 +00:00
parent 97bd6162c5
commit 526d4f6e1b
2 changed files with 2 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
{% import 'macros/links.html' as links %}
{% call links.link(url_for('auth.newsletters'), hx_select_search, select_colours, True, aclass=styles.nav_button) %}
{% call links.link(coop_url('/auth/newsletters/'), hx_select_search, select_colours, True, aclass=styles.nav_button) %}
newsletters
{% endcall %}
<div class="relative nav-group">

View File

@@ -1,7 +1,7 @@
{% import 'macros/links.html' as links %}
{% macro header_row(oob=False) %}
{% call links.menu_row(id='auth-row', oob=oob) %}
{% call links.link(url_for('auth.account'), hx_select_search ) %}
{% call links.link(coop_url('/auth/account/'), hx_select_search ) %}
<i class="fa-solid fa-user"></i>
<div>account</div>
{% endcall %}