My algolia index creatorUid which either has the PRESET_EXPORTER. Everybody should be allowed to read the PRESET_EXPORTER documents. Additionally users should only be allowed to read their own documents (where creatorUid is the user's id).
Therefore, I created an API Key with the query parameter filters=(creatorUid:PRESET_EXPORTER).
This API Key works as intended, it allows to search for PRESET_EXPORTER documents.
Additionally, for each user I create their own secured API Key like this:
const originalApiKey = '3398a693e444dd393fd84c80824fd6a9';
const filters = `(creatorUid:PRESET_EXPORTER OR creatorUid:${uid})`;
const securedApiKey = client.generateSecuredApiKey(originalApiKey, { filters });
console.log(securedApiKey);
However, I can't load the documents where the user's id matches the creatorUid.
Interestingly, when I edit my parent Search Key to use the query parameter filters=(creatorUid:PRESET_EXPORTER OR creatorUid:rYdMeaLPvsXO6YqU0iuwdVTrhyS2) it does work as intended. This must mean that something with the secured API Key does not work.
Any ideas where the issue could be?