fitzroyacademy / web-app

The main web app
0 stars 0 forks source link

bug: Anonymous user can't access free public course #193

Open Yuffster opened 4 years ago

Yuffster commented 4 years ago

The default stub course is set to anonymous and free.

However, when I log out and try to enroll in the course, or type in a URL to view lessons directly, I get sent back to the course intro page.

Yuffster commented 4 years ago

Looks like enrollment is always required in segment.py:

https://github.com/fitzroyacademy/web-app/blob/6fc89a4e3526271fb42846ef50035d70b13ac824/routes/segment.py#L296-L297

And decorators.py:

https://github.com/fitzroyacademy/web-app/blob/6fc89a4e3526271fb42846ef50035d70b13ac824/routes/decorators.py#L45-L69

Anonymous users should be able to access guest_access=True courses.

It might be a good idea to add a utility method on Course, can_access(self, user=None) to keep the logic for this contained.

mkarpicz commented 4 years ago

@Yuffster I can't replicate this bug.

mkarpicz commented 4 years ago

I think I know what is an issue. Probably different understanding of anonymity. You don't have to be logged in, but you need to click "enroll". Then you can start a course but we keep this information in a user's session.