Module auth/storage/token-store

Authentication Token Compatibility Layer Module

Provides a backward-compatible interface that maintains the original token management API while delegating to the new modular token services. This module exists solely to support existing code that depends on the old API.

Features:

  • Complete compatibility with legacy token API
  • Transparent delegation to specialized token modules
  • Consistent function signatures for all token operations
  • Re-exported constants for consistent token naming
  • Clean transition path from legacy to modern token API

This module serves as a facade over the modular token management system, allowing existing code to continue functioning while new code can directly use the more specialized token modules. It simply passes through all calls to the appropriate specialized modules without adding any business logic.

New code should import directly from the specialized token modules rather than using this compatibility layer.

Functions

setTokens
clearTokens
getAccessToken
getRefreshToken
isAuthenticated
getTokenExpiry
refreshAccessToken
initTokenStore

References

ACCESS_TOKEN_KEY → ACCESS_TOKEN_KEY
REFRESH_TOKEN_KEY → REFRESH_TOKEN_KEY
TOKEN_EXPIRY_KEY → TOKEN_EXPIRY_KEY
REFRESH_MARGIN → REFRESH_MARGIN