Variable tokenStoreConst

tokenStore: { clear(): void; get(): null | string; set(token: string): void } = ...

Persisted access-token accessor.

Thin wrapper over localStorage under the fixed key "token". It is the single source of truth used by AuthProvider and by the axios interceptors in createApiClient, so reading and writing tokens here keeps the UI and the network layer in sync.

Notes:

  • Stores the raw JWT string; it is not encrypted.
  • get() returns null when no token is present.

Type declaration

  • clear:function
    • Remove the stored token.

      Returns void

  • get:function
    • Return the stored token, or null if none is set.

      Returns null | string

  • set:function
    • Persist token under the shared storage key.

      Parameters

      • token: string

      Returns void

tokenStore.set("eyJhbGciOi...");
tokenStore.get(); // "eyJhbGciOi..."
tokenStore.clear();
tokenStore.get(); // null