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

Fix withItemData treating sessions that don't match an item as valid #5168

Merged

Conversation

emmatown
Copy link
Member

To test this, start one of the examples with a new database, create a user then restart the example with a new database and go the admin ui again and you should be prompted to create a new user rather than be logged in

@emmatown emmatown requested a review from a team March 19, 2021 04:56
@changeset-bot
Copy link

changeset-bot bot commented Mar 19, 2021

🦋 Changeset detected

Latest commit: 5c099df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
@keystone-next/keystone Major
@keystone-next/test-utils-legacy Patch
@keystone-next/benchmarks-legacy Patch
@keystone-next/example-auth Patch
@keystone-next/app-basic Patch
@keystone-next/example-ecommerce Patch
keystone-next-app Patch
@keystone-next/example-roles Patch
@keystone-next/example-sandbox Patch
@keystone-next/example-todo Patch
@keystone-next/admin-ui Patch
@keystone-next/auth Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/keystonejs/keystone-next-docs/BDnWtbRWLit2JYGWsSg6SxzoPE5Z
✅ Preview: https://keystone-next-git-fix-with-item-data-treating-invalid-i-65af3d.vercel.app

Comment on lines -107 to -110
// If there is no matching item found, return the session without a `data value
if (!item) {
return session;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this case never happened because findOne throws when it doesn't find an item

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 19, 2021

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

Sandbox Source
@keystone-next/example-sandbox Configuration

@emmatown emmatown removed the request for review from a team March 19, 2021 05:00
@emmatown emmatown marked this pull request as draft March 19, 2021 05:00
@vercel vercel bot temporarily deployed to Preview March 19, 2021 05:08 Inactive
@vercel vercel bot temporarily deployed to Preview March 21, 2021 23:29 Inactive
@emmatown emmatown marked this pull request as ready for review March 21, 2021 23:41
@vercel vercel bot temporarily deployed to Preview March 21, 2021 23:41 Inactive
@emmatown emmatown requested a review from a team March 21, 2021 23:41
Copy link
Contributor

@timleslie timleslie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@emmatown emmatown merged commit 343b742 into master Mar 22, 2021
@emmatown emmatown deleted the fix-with-item-data-treating-invalid-items-as-valid-sessions branch March 22, 2021 00:04
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