Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui.publicPages should bypass ui.isAccessAllowed and ui.pageMiddleware #8120

Merged
merged 5 commits into from
Nov 24, 2022

Conversation

dcousens
Copy link
Member

I think the previous behaviour was unintentionally misleading; and although #8115 resolved the behaviour as near to what existed before, I don't think this what developers are expecting.

Public pages shouldn't be redirected conditionally in respect to the session, they are public pages.

If they can be conditionally re-directed as a result of ui.isAccessAllowed or some other behaviour, then they aren't public pages, but conditional pages, and can be handled using ui.pageMiddleware.

This pull request resolves that ambiguity as a separate followup to #8115.

This pull request additionally restores a small optimization that we had which prevented hasInitFirstItemConditions calling the database for every request if a session already exists (and thereby, initialization already completed).

@changeset-bot

This comment was marked as resolved.

@vercel

This comment was marked as resolved.

@dcousens dcousens requested a review from emmatown November 24, 2022 03:11
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f38970f:

Sandbox Source
@keystone-6/sandbox Configuration

@dcousens dcousens merged commit 0acbb70 into main Nov 24, 2022
@dcousens dcousens deleted the early-public-pages branch November 24, 2022 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants