fix(bi): use correct auth token key for cost-config API calls
Fixed authentication issue where loadCostConfig() and saveCostConfig() were using wrong localStorage key 'tractatus_token' instead of 'admin_token' (accessed via getAuthToken()). This caused "jwt malformed" 401 errors because: - audit-logs endpoint: uses admin_token (works ✓) - cost-config endpoint: was using tractatus_token (broken ✗) Changed both functions to use getAuthToken() for consistency. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d3f33300e3
commit
ad5aceeec5
1 changed files with 2 additions and 2 deletions
|
|
@ -903,7 +903,7 @@ function showError(message) {
|
|||
// Cost Configuration
|
||||
async function loadCostConfig() {
|
||||
try {
|
||||
const token = localStorage.getItem('tractatus_token');
|
||||
const token = getAuthToken();
|
||||
const response = await fetch('/api/admin/cost-config', {
|
||||
headers: { 'Authorization': `Bearer ${token}` }
|
||||
});
|
||||
|
|
@ -922,7 +922,7 @@ async function loadCostConfig() {
|
|||
|
||||
async function saveCostConfig(costFactors) {
|
||||
try {
|
||||
const token = localStorage.getItem('tractatus_token');
|
||||
const token = getAuthToken();
|
||||
const response = await fetch('/api/admin/cost-config', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue