fix(brand-catalog): add JWT auth token to all API requests

brand-catalog.js was missing Authorization header on fetch calls,
causing 401 Unauthorized errors. Now reads pos_token from localStorage
and includes Bearer token in every request. Also handles 401 responses
by redirecting to /pos/login. Bump JS cache bust to v=2.
This commit is contained in:
2026-05-14 21:26:10 +00:00
parent 9da14e40da
commit c6b3ca9bdf
3 changed files with 137 additions and 58 deletions

View File

@@ -294,6 +294,6 @@
<script src="/pos/static/js/onboarding.js" defer></script>
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('/pos/sw.js',{scope:'/pos/'});}</script>
<script src="/pos/static/js/pwa-install.js" defer></script>
<script src="/pos/static/js/brand-catalog.js?v=1" defer></script>
<script src="/pos/static/js/brand-catalog.js?v=2" defer></script>
</body>
</html>