strapi-community / strapi-plugin-protected-populate

MIT License
20 stars 5 forks source link

BUG: Protected Routes omit localizations #14

Closed PrinzJuliano closed 1 year ago

PrinzJuliano commented 1 year ago

When protecting a route, the populated localizations will always be omitted.

Using the strapi i18n Plugin does not work with protected-routes. After manually adding the locale field in the config file, as the GUI does not support that, the field is returned. However, the populated localizations cannot be added this way.

With an unprotected route, populating the localizations Field will return all entities with their respective locale.
When protecting the route, the population will be omitted, with no way to add it back.

I tried adding it to the populate section in the index.json to no avail.

Boegie19 commented 1 year ago

@PrinzJuliano Will take a quick look

Boegie19 commented 1 year ago

@PrinzJuliano Looked into it and can't replicate the is issue. if I do. http://localhost:1337/api/blogs?locale=nl and api/blogs is protected I don't have any issues.

PrinzJuliano commented 1 year ago

For testing:

Accessing the findAll Route works as expected. Populating the localizations of a find One Route does not work when using the protected populations plugin.

I am sorry to not have clarified and provided a testing scenario.

Boegie19 commented 1 year ago

I see now it is correct that is blocked I will write an update this weekend what will fix this issue

PrinzJuliano commented 1 year ago

Thank you very much for your work. If you need anything to further test this issue, I am more than happy to provide. This plugin elevates some of the pain points I have in working and writing code for strapi customization.

Boegie19 commented 1 year ago

@PrinzJuliano strapi-plugin-protected-populate@1.3.3 should fix your issue I added localizations to the UI when localization is enabled on the content-type

PrinzJuliano commented 1 year ago

Thanks, I will try the update

PrinzJuliano commented 1 year ago

I have tried the update and can report that everything works as expected.

Thank you very much for your work.