• Retrieves a token value from memory storage

    Gets a specific token value from memory storage with type safety. The generic parameter T allows for proper typing of the returned value.

    Type Parameters

    Parameters

    • key: string

      Token key to retrieve

    Returns null | T

    The stored value or null if not found

    // Get access token with proper typing
    const accessToken = retrieveTokenValue<string>(ACCESS_TOKEN_KEY);
    if (accessToken) {
    // Use the access token
    }

    Use getAccessToken, getRefreshToken, etc. from token-operations instead

    export function retrieveTokenValue<T extends TokenValue>(
    key: string,
    ): T | null {
    return (memoryTokenStorage[key] as T) || null;
    }