Fix "Session Expired" Error

Archived Document Notice (2026-02-12): This file is retained for historical context and may not reflect current code, APIs, runtime defaults, CI status, or deployment posture. Use active documentation under docs/ as authoritative.

The Problem

The UI is loading an OLD token from localStorage (browser cache). That token has expired.

The Solution

  1. Open Developer Tools (Press F12)
  2. Go to Application tab (Chrome) or Storage tab (Firefox)
  3. On the left, find Local Storage → http://localhost:3000
  4. Click Clear All or delete these keys:
    • icn-token
    • icn-token-expiry
    • icn-gateway
    • icn-coop
    • icn-did
  5. Refresh the page (F5)
  6. Login again with the new credentials

Option 2: Use Console to Clear

  1. Press F12 to open Developer Tools
  2. Go to Console tab
  3. Paste this command and press Enter:
    localStorage.clear();
    location.reload();
    
  4. Login again with the new credentials

Option 3: Private/Incognito Window

  1. Open a new private/incognito window
  2. Go to http://localhost:3000
  3. Login with the new credentials

Option 4: Logout First

If you can see the dashboard:

  1. Click your profile/settings
  2. Click Sign Out or Logout
  3. Login again with the new credentials

Fresh Credentials to Use

Gateway URL: http://localhost:8080
Cooperative ID: rochester-tool-library
DID: did:icn:zBFnhJhgvRjgukhQmkq9ddBz5wiEt32ptkQkBDjWx6uPh

Token:

PASTE-DEV-TOKEN-HERE

Expires: 22:57 UTC (58 minutes from now)


Quick Console Command

Press F12, go to Console tab, paste this:

// Clear old credentials
localStorage.clear();

// Set new credentials
localStorage.setItem('icn-gateway', 'http://localhost:8080');
localStorage.setItem('icn-coop', 'rochester-tool-library');
localStorage.setItem('icn-did', 'did:icn:zBFnhJhgvRjgukhQmkq9ddBz5wiEt32ptkQkBDjWx6uPh');
localStorage.setItem('icn-token', 'PASTE-DEV-TOKEN-HERE');
localStorage.setItem('icn-token-expiry', '1766098672000');

// Reload page
location.reload();

This will automatically set everything and reload the page. You should go straight to the dashboard!


Verify It Worked

After clearing and logging in, check the Console (F12) for:

  • ✅ No more "401 Unauthorized" errors
  • ✅ No more "session expired" messages
  • ✅ Balance loads (even if empty)
  • ✅ Dashboard displays

The token IS valid and works with the API - it's just a caching issue!