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

(re)Add support for publicPage redirects using pageMiddleware #8280

Merged
merged 13 commits into from
Jan 30, 2023

Conversation

dcousens
Copy link
Member

@dcousens dcousens commented Jan 30, 2023

#8115 removed support for pageMiddleware being called for publicPages, as it was determined that the existing behaviour was error-prone as written as a result of the dynamic between isAccessAllowed and pageMiddleware as written.

This pull request re-introduces support for pageMiddleware to be used for publicPages by renaming the boolean flag isValidSession to wasAccessAllowed. This removes the ambiguity that this flag related to anything except the isAccessAllowed function.

When calling pageMiddleware, wasAccessAllowed is always true for pages that are in the publicPages array.
isAccessAllowed is NOT called for public pages.

@vercel
Copy link

vercel bot commented Jan 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
keystone-next-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 30, 2023 at 6:23AM (UTC)

@changeset-bot

This comment was marked as resolved.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 30, 2023

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 5c4ec74:

Sandbox Source
@keystone-6/sandbox Configuration

@vercel vercel bot temporarily deployed to Preview January 30, 2023 00:38 Inactive
@vercel vercel bot temporarily deployed to Preview January 30, 2023 00:47 Inactive
@vercel vercel bot temporarily deployed to Preview January 30, 2023 01:24 Inactive
@vercel vercel bot temporarily deployed to Preview January 30, 2023 01:28 Inactive
@vercel vercel bot temporarily deployed to Preview January 30, 2023 06:16 Inactive
@dcousens dcousens enabled auto-merge (squash) January 30, 2023 06:21
@vercel vercel bot temporarily deployed to Preview January 30, 2023 06:23 Inactive
@dcousens dcousens merged commit 384748d into main Jan 30, 2023
@dcousens dcousens deleted the public-redirects branch January 30, 2023 06:29
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.

None yet

2 participants