tpiros / jamstack-training-films-ui

jamstack-training-films-ui.vercel.app
34 stars 22 forks source link

Can't login with authenticated users #1

Open waheed11 opened 2 years ago

waheed11 commented 2 years ago

Hello, I followed the course “Create your "next" app using Next.js and Strapi” and downloaded the two repositories at GitHub but I found an issue when I tried the users’ roles. I created a new authenticated user and changed the “find” and “findOne” permissions of “Film” and “Review” in the role setting for authenticated users only. But when I login by the new authenticated user and click on “Films” at the menu, it gives me the following error: TypeError: Cannot read properties of undefined (reading 'pagination')

Please how to solve this problem? issue

tpiros commented 2 years ago

Hi @waheed11 - thank you for taking the course. Can you confirm that you're using Strapi v4 please?

waheed11 commented 2 years ago

Yes I am using Strapi v4

waheed11 commented 2 years ago

It works fine when I give “find” and “findOne” permissions of “Film” for "Public"

tpiros commented 2 years ago

thank you for clarifying. I think I mention this at some point in the course as well. The films (and therefore the listing of all the films, including the meta prop used for pagination) is available to both logged in and logged out users, you need to make sure that you check both the public and authenticated roles' find and findOne checkboxes.

tpiros commented 2 years ago

btw, as far as I know, Strapi currently doesn't automagically propagate these permissions but it'd be a nice features and it's something that I brought up for @malgamves.

malgamves commented 2 years ago

we just launched a feedback portal at https://feedback.strapi.io - PMs are watching and would be surely added to the roadmap

waheed11 commented 2 years ago

@malgamves thank you providing a feedback. Could you please send the link of the feedback you have created