Back to articles
Fixing a Login Loop in a Unified Admin for ERP + EC Platform: The Dual-Token Auth Approach
How-ToTools

Fixing a Login Loop in a Unified Admin for ERP + EC Platform: The Dual-Token Auth Approach

via Dev.tolinou518

Fixing a Login Loop in a Unified Admin for ERP + EC Platform: The Dual-Token Auth Approach What Happened While building the Admin panel for techsfree-platform (a unified dashboard controlling both an ERP system and an EC shop), I hit an annoying bug. Symptom: after logging in, EC-related pages (products, orders, members) loaded fine — but navigating to any ERP-related page (sales, purchasing, inventory) redirected to /login . Clicking around just created an infinite login loop. Architecture Background This project has two separate backends controlled by one Admin UI: Platform backend (port 3210) — EC features (products/orders/members), with its own JWT ( tf_token ) ERP backend (port 8520) — Sales/purchasing/inventory, also with its own JWT ( erp_token ) The ERP part was originally a separate project, so the auth tokens are completely independent. Root Cause One look at erpApi.ts (the Axios client for ERP calls) revealed the culprit: instance . interceptors . response . use ( response =

Continue reading on Dev.to

Opens in a new tab

Read Full Article
5 views

Related Articles