async get()

in packages/oauth-client/src/OAuthLocalStorage.ts [21:36]


  async get<T>(key: string): Promise<T | null> {
    const valueAsStr = window.localStorage.getItem(key);

    if (valueAsStr === null) {
      return null;
    }

    try {
      return JSON.parse(decodeBase64(valueAsStr)) as T;
    } catch (e) {
      this.#logger?.error('Failed to parse value for given key as JSON from localStorage', e);

      // note: For now we can assume that a malformed token is the same as no token
      return null;
    }
  }