Replies: 3 comments 4 replies
-
Hello @BorisKamp I'm sorry you have this issue.
Knowing this, it means the issue is not on the Meilisearch side, but directly on your code Can you check
|
Beta Was this translation helpful? Give feedback.
-
@curquiza thank you for your answer! Well to make it even more special, I have multiple user roles (admins and agents), admins have the search api token on their account and use that to search (no filters), agents have the tenant token with filters. When I log in as an admin, I can search, everything works. But when I login as an agent with the tenant token, I get the 403
You can use the token, it's not sensitive, it's still a staging environment, but live. And again, it works for admins with the search api token. You can try the token in postman with the host I specified, it works. Im lost how this can be.... |
Beta Was this translation helpful? Give feedback.
-
Okay I found the issue. It is not very clear tho so I definitely advise an improvement for the error/docs. It turns out I was using an index in my client that was not specified in the tenant token In my Nuxt app I used this index: ...
{
indexUid: 'exhibition',
attributesToHighlight: ['name'],
},
..... And my tentant token const tokenPayload = {
searchRules: {
agent: {
filter: `id = ${user.agent.id}`
},
collo: {
filter: `manifest.agent.id = ${user.agent.id}`
},
'log-entry': {
filter: `creator.agent.id = ${user.agent.id}`
},
manifest: {
filter: `agent.id = ${user.agent.id}`
},
'manifest-entry': {
filter: `agent.id = ${user.agent.id}`
},
},
apiKeyUid: apiKeyUid,
}; It turns out you need to specifically add |
Beta Was this translation helpful? Give feedback.
-
Hi!
I have the following function in my strapi project to generate and set the
meilisearch_tenant_token
on the strapi user:This generates the token just fine, and when I use them in postman on my prod url, they work.
However, in my NuxtJS frontend project, when I use them like this:
I get a 403 when I try it with a user that has a tenant token, the admin users that use the
MEILISEARCH_SEARCH_API_KEY
(see strapi function) do get the search results with any issues.In my logs I can see the following:
I have no clue what is going on here.
Does anybody have a clue?
Beta Was this translation helpful? Give feedback.
All reactions