Skip to content

refactor: remove redundant localStorage token writes #81

Description

@EmeditWeb

Problem

user.store.ts (lines 19-20) writes accessToken and refreshToken to localStorage manually AND uses Zustand persist middleware. This dual-source-of-truth causes inconsistencies.

What To Build

  1. Remove manual localStorage writes from setTokens()
  2. Ensure Zustand persist middleware stores tokens correctly
  3. Verify api.ts interceptor reads from store (not localStorage directly)

Files To Touch

  • src/stores/user.store.ts — lines 19-20 remove localStorage writes

Acceptance Criteria

  • Tokens persisted solely through Zustand persist middleware
  • No manual localStorage writes in any store
  • Auth flow still works end-to-end

Mandatory Checks

  • context/ files read
  • npm run build passes
  • npm test passes
  • PR references this issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions