Const
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.
localStorage
"token"
AuthProvider
createApiClient
Notes:
get()
null
Remove the stored token.
Return the stored token, or null if none is set.
Persist token under the shared storage key.
token
tokenStore.set("eyJhbGciOi...");tokenStore.get(); // "eyJhbGciOi..."tokenStore.clear();tokenStore.get(); // null Copy
tokenStore.set("eyJhbGciOi...");tokenStore.get(); // "eyJhbGciOi..."tokenStore.clear();tokenStore.get(); // null
Persisted access-token accessor.
Thin wrapper over
localStorageunder the fixed key"token". It is the single source of truth used byAuthProviderand by the axios interceptors increateApiClient, so reading and writing tokens here keeps the UI and the network layer in sync.Notes:
get()returnsnullwhen no token is present.